I'm doing an interesting mechanic on the server where small zombies spawn around the player. How can I make a small zombie attack everyone except a certain player?
Here is my script:
on damage:
victim is a player
if {tag::%victim's uuid%} is "Infected":
if attacker is a player or a mob:
if {baby zombie::%victim's uuid%} is not set: # Checking to see if a zombie already exists
set {_loc} to location of victim
add random integer between -2 and 2 to x-coordinate of {_loc}
add random integer between -2 and 2 to z-coordinate of {_loc}
spawn a baby zombie at {_loc}
set {_zombie} to last spawned entity
set {baby zombie::%victim's uuid%} to {_zombie}
send "&cbaby zombie has been spawned!" to victim
# Removing zombie after 1 minute
wait 1 minutes
if {_zombie} is alive:
kill {_zombie}
delete {zombie::%victim's uuid%}
Here is my script:
on damage:
victim is a player
if {tag::%victim's uuid%} is "Infected":
if attacker is a player or a mob:
if {baby zombie::%victim's uuid%} is not set: # Checking to see if a zombie already exists
set {_loc} to location of victim
add random integer between -2 and 2 to x-coordinate of {_loc}
add random integer between -2 and 2 to z-coordinate of {_loc}
spawn a baby zombie at {_loc}
set {_zombie} to last spawned entity
set {baby zombie::%victim's uuid%} to {_zombie}
send "&cbaby zombie has been spawned!" to victim
# Removing zombie after 1 minute
wait 1 minutes
if {_zombie} is alive:
kill {_zombie}
delete {zombie::%victim's uuid%}