Minecraft Java Edition – How to Select the Entity that Activates a Command Block or Sign

minecraft-commandsminecraft-java-edition

This is a very important Question to me, as it relates to my Server/Realm as I use completely command blocks for everything, and due to the point that the closest thing to detecting the activator is using @p, I guess you could see where that would go wrong with a lot of players.

So if anyone can, is there a method of using /execute or /testfor to detect this?
I'm trying to teleport specific players who click a button by the way. Also I have a sign that when clicked also teleports the players, is there a method of doing this for command signs aswell?

Best Answer

When a player clicks on a sign with a command, it's automatically executed as that player, so you can use a trigger command to let the player set a score for themselves by clicking the sign. Then you just do things based on that score.