Selecting player talking to npc
When running a command from an NPC, is there any current approach with selectors to actually select the player talking to the NPC?
This would be extremely helpful for executing commands under a particular user that just talked to an NPC, not just @p which breaks if another student stands between player 1 and the NPC. I am talking about this in relation to a multiplayer environment, with many students in the same world.
-
@e
-1 -
@e isn’t the answer, given that selects all entities? (Or can be specifies down to specific entities).
I am asking about a mechanism to select the player that is talking with an NPC, in a multiplayer environment. I am not looking to select an NPC.0 -
Sorry you are right, the correct answer is @p - it interacts with the next player - the player that is closest to the NPC
-1 -
As mentioned in my initial post, @p isn’t a viable option either, as it selects the nearest player... In a world with 30 students, there is nothing stopping another student standing between player 1 and the NPC, therefor getting caught by the commands executed by the NPC instead.
The point is, I am asking for a selector that isn’t based on distance, but is actually selecting the player that is talking to the NPC.
0 -
I have asked for this as well. Same problem with using a button. I wish there was a selector @x or @t to select whoever clicked the button.
0
Please sign in to leave a comment.
Comments
5 comments