I want to give undead mobs in a certain radius instant health potions, but I don't know how to only target undead mobs.
effect give @e[distance=1..7, type=undead] minecraft:instant_health 7 10
But there is no "undead" mob type. At least in this context.
Any help would be appreciated.
Best Answer
Assuming you're using a data pack, which you should be doing if this is a big project. Create an entity tag named
minecraft:undead
with the following contents:Then target those entities with the following target selector:
If you're not using a data pack, then have one command per possible entity type, or switch to using a data pack (highly recommended)