Hello everyone! I searched a lot on the net, but I've found only old threads talking about this. Is possibile to make a mob attack another mob (e.g. Zombie attacking another Zombie, Spider -> Skeleton etc.), as if the attacked was a player? I tried with Entity.setTarget(), but it seems working only with Player targets, in my case.The target is correctly set, but the zombie doesn't move/attack. Maybe I need to use NMS classes? Edit: I noticed that skeletons attack other entities, while zombies and spiders no.
You can try to use the setTarget(LivingEntity entity) method. This allows you to set the mob's target to any living entity. If it's a hostile creature, it will attacked the set target. If it's a non-hostile entity, it will follow the set entity. Find more about it at https://hub.spigotmc.org/javadocs/spigot/ and find the Creature interface