Started by
ItzBlueJacob
on
Topic category: Help with Minecraft modding (Java Edition)
Hello! I'd like to know is it even possible for mobs to not attack baby mobs? I'm working on a mod that adds illagers and since in 1.18+ the vanilla ones do not attack baby villagers
And I plan to make my illagers do the same, is it possible for me to make a procedure/trigger to prevent them from attacking baby villagers?
you can use the metadata plugin to check the villager's Age tag. if the age is less than zero, it is a baby.
an important note: if you ever want to carry this over to mobs that don't grow up if they are babies (zombies, drowned, etc): they have a separate IsBaby tag that controls if they're a baby or not