#Detect player who placed respawn anchor

1 messages · Page 1 of 1 (latest)

proper remnant
#

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}% "```
hollow wharf
#

can you not just do
on place of respawn anchor:
set {var} to player / event-entity

frank hawk
#

^