In the new 1.15 version of minecraft, i'm trying to make a command that inflicts wither on the entity that you hit. I haven't been able to find it out myself, but I was hoping that one of you could help me with it. If possible, would there be a way to make the wither not happen to animals and passive mobs?
Now, put in command blocks this commands for detect a mob/player hurt and reset scoreboard:
/execute as @a[scores={attacked=1..}] at @s run effect give @e[distance=.1..5,nbt={HurtTime:10s},sort=nearest,limit=1] minecraft:wither 10 0
/scoreboard players set @a attacked 0
To not cause the effect on passive mobs, you must specify each mobs like this: in the "effect give @e[]" command, add "type=!mobname" for each animal you want to exclude.
In the new 1.15 version of minecraft, i'm trying to make a command that inflicts wither on the entity that you hit. I haven't been able to find it out myself, but I was hoping that one of you could help me with it. If possible, would there be a way to make the wither not happen to animals and passive mobs?
Create a scoreboard to detect player attacked:
Now, put in command blocks this commands for detect a mob/player hurt and reset scoreboard:
To not cause the effect on passive mobs, you must specify each mobs like this: in the "effect give @e[]" command, add "type=!mobname" for each animal you want to exclude.
Anything contact me on discord
Thank you for the help.