Hi, I'm trying to make it so when if I have a full set of armor that contains the lore undead,
it makes it so mobs do not attack me unless I attack them.
I've gotten the messages to print and variables to work before, but I can't seem to make it so
mobs only do not hit the players in the full set. I have to remove the conditions on in entity target for it to work.
it makes it so mobs do not attack me unless I attack them.
I've gotten the messages to print and variables to work before, but I can't seem to make it so
mobs only do not hit the players in the full set. I have to remove the conditions on in entity target for it to work.
Code:
function contains(list: objects, check: object) :: boolean:
loop {_list::*}:
if loop-value is {_check}:
return true
return false
on armor equip:
wait 10 ticks
if "%lore of player's helmet%" contains "Undead":
if "%lore of player's chestplate%" contains "Undead":
if "%lore of player's leggings%" contains "Undead":
if "%lore of player's boots%" contains "Undead":
add "%player%" to {_Undead::*}
send {_Undead::*} to player
send "&e&l(!) &r&eYou now have the &nUndead Set Bonus!&r &eRegular hostile mobs will no longer attack you." to player
on entity target:
if entity's target is a player:
if contains({_Undead::*}, "%player%") is true:
send {_Undead::*} to player
cancel event
on armor unequip:
if "%lore of player's helmet%" contains "Undead":
if "%lore of player's chestplate%" contains "Undead":
if "%lore of player's leggings%" contains "Undead":
if "%lore of player's boots%" contains "Undead":
remove "%player%" from {_Undead::*}
send {_Undead::*} to player
send "&c&l(!) &r&cYou no longer have the &e&nUndead Set Bonus!" to player