This codes works and detect the attacker (the one who placed the anchor).
The problems is that it creates to many variables.
can someone help me find a way to delete the variables or a different way to detect the attacker?
if world is "world":
if {block.%event-block%} is not set:
if player is holding a glowstone block:
set {block.%event-block%} to 1
else:
if player is not holding a glowstone block:
set {respawnAnchorClick} to player
else:
add 1 to {block.%event-block%}
if {block.%event-block%} is 5:
set {respawnAnchorClick} to player
on death:
broadcast "%victim% &ewas blown up by %{respawnAnchorClick}% "```