Hello, I'm new to to scripting and I've been trying to make mobs not attack specific players and can't find out why my code does not work. There are also no errors when I reload it.
Code:
command /ghost:
trigger:
if {g.%player%} is not set:
set {g.%player%} to false
if {g.%player%} is false:
set {g.%player%} to true
send "&3You are now a ghost&6!"
else if {g.%player%} is true:
set {g.%player%} to false
send "&3You are no longer a ghost&6!"
on entity target:
if target is a player:
if {g.%player%} is true:
cancel event
on join:
if {g.%player%} is true:
send "&3You are a ghost&6!"