What commands to use to make a zombie which after hitting the player will give the player the poison effect?

I tried the execute command but the effect was that when I hit the zombie I was wearing a poison effect...

1

2 Answers

You can do something that while technically doesn't give the player poison on hit, gives it when they are standing so close to it that they would be hit.

execute at @e[type=minecraft:zombie,name="My Name, or something else to distinguish me"] run effect give @p[r=...35] poison 30 0
1
/summon zombie ~ ~1 ~ {HandItems:[{Count:1,id:golden_sword,tag:{display:{Name:"\"Lucian\""},Enchantments:[{id:sharpness,lvl:1}]}},{}],HandDropChances:[1.0f,0.0f],ActiveEffects:[{Id:19,Amplifier:0,Duration:999999}]}
1

You Might Also Like