So I'm making a script where when the player inputs /applearmy and if the player's name is "Applespog" and the cooldown is ready, then spawns 5 zombies with apples on their heads.
Sadly after killing one mob they just kill me instead of hunting for others, Can you please fix this? Thanks.
Code:
command /applearmy:
trigger:
if the player's name is "Applespog":
if {appleexplosioncld.%player%} is 0:
loop all baby zombies in radius 50 of the player:
if the helmet of loop-entity is an apple:
kill loop-entity
loop 5 times:
spawn a baby zombie
set helmet of last spawned entity to apple
add the last spawned entity to {mob::*}
set tool of last spawned entity to iron sword of sharpness 1
apply speed 3 to the last spawned entity for 30 seconds
loop all entities in radius 10 around player:
if loop-entity is not the player:
if loop-entity's helmet is not an apple:
set target of {mob::*} to loop-entity
set {appleexplosioncld.%player%} to 30
while {appleexplosioncld.%player%} > 0:
wait 1 second
remove 1 from {appleexplosioncld.%player%}
else:
send action bar "&c%{appleexplosioncld.%player%}% Seconds remaining " to player
Sadly after killing one mob they just kill me instead of hunting for others, Can you please fix this? Thanks.