I am trying to make code that will summon 2 zombies with armor at once on either side of the player, while also giving armor and buffs to both. How would I do that?
Here's my current code, the last works for just one, but the first doesn't work:
on rightclick:
if player's tool is {customitem::mobbook}:
spawn 2 zombies at location of player
equip first spawned zombie with diamond helmet of protection 3
equip first spawned zombie with diamond chestplate of protection 3
equip first spawned zombie with diamond leggings of protection 4
equip first spawned zombie with diamond boots of protection 4
apply strength 10 to first spawned zombie for 10 minutes
apply speed 6 to first spawned zombie for 10 minutes
equip last spawned zombie with diamond helmet of protection 3
equip last spawned zombie with diamond chestplate of protection 3
equip last spawned zombie with diamond leggings of protection 4
equip last spawned zombie with diamond boots of protection 4
apply strength 10 to last spawned zombie for 10 minutes
apply speed 6 to last spawned zombie for 10 minutes
on entity target:
if first spawned zombie's target has {customitem::mobbook} in inventory:
cancel event
on entity target:
if last spawned zombie's target has {customitem::mobbook} in inventory:
cancel event
Here's my current code, the last works for just one, but the first doesn't work:
on rightclick:
if player's tool is {customitem::mobbook}:
spawn 2 zombies at location of player
equip first spawned zombie with diamond helmet of protection 3
equip first spawned zombie with diamond chestplate of protection 3
equip first spawned zombie with diamond leggings of protection 4
equip first spawned zombie with diamond boots of protection 4
apply strength 10 to first spawned zombie for 10 minutes
apply speed 6 to first spawned zombie for 10 minutes
equip last spawned zombie with diamond helmet of protection 3
equip last spawned zombie with diamond chestplate of protection 3
equip last spawned zombie with diamond leggings of protection 4
equip last spawned zombie with diamond boots of protection 4
apply strength 10 to last spawned zombie for 10 minutes
apply speed 6 to last spawned zombie for 10 minutes
on entity target:
if first spawned zombie's target has {customitem::mobbook} in inventory:
cancel event
on entity target:
if last spawned zombie's target has {customitem::mobbook} in inventory:
cancel event