I want hostile mobs to attack each other using commands. I know something like entity.setTarget
will work, but I don't know where to put it (Where in the summon command).
-
I remember one of the not too recent snapshot adding an NBT exactly for this though I can't find a single trail of detail that hints even anything similar.– Q20Commented Oct 22, 2015 at 8:28
-
I found out if a skeleton hits an enderman with a bow and arrow, it will become hostile. True.– Jim JonesCommented Dec 19, 2015 at 3:34
2 Answers
First, summon the target mob with determined a UUIDLeast and UUIDMost. For example:
/summon Wolf ~ ~ ~ {UUIDLeast:0L,UUIDMost:0L}
Then, simulate the target mob hitting the attacker mob with a snowball to make the attacker angry, like this:
/execute @e[type=Creeper] ~ ~ ~ /summon Snowball ~ ~2.8 ~ {ownerName:"0-0-0-0-0"}
(OwnerName needs to be the UUID of the entity summoned in the first stage.)
the way i would do it would be i would make a villager on team 1 and another on team 2. then make 2 zombies and one on team 1 and another on team 2. then i would set friendly fire off for both the teams. now make the villagers invisible. then if they get close enought they will attack each other. this wont make them kill each other. but they attack each other. then to make them kill each other you could make it detect if the villager died, and if it did its team mate would be killed. im sorry but i cant simplify my explanations that well. i always make my things too complicated