We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

16

@a, @e, @p, etc.

3 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 2
    Registered User commented
    Comment actions Permalink

    This is a highly requested feature but commands don't have the ability to "trace back" through the physical world to find who activated it. This has been requested many times before but I don't think it'll be coming soon. @p (nearest player) is the closest you'll get to that.

  • 0
    Registered User commented
    Comment actions Permalink

    I know I'm really late, but..

    There's an @initiator command that targets the player, but it only works with the NPC mob (Bedrock) So perhaps you could interact with a hidden npc that runs the command, but it's not a good solution.

  • 0
    Registered User commented
    Comment actions Permalink

    The closest way we have to do what you require is by using @a along with scoreboards. For example, you can apply an effect to all players (@a) who have reached a specific score, like:

      /execute if entity @a[scores={objective1=1}] run effect give @a[scores={objective1=1}] minecraft:regeneration 5

    and then reset their score after applying the desired effect with:

      /scoreboard players reset @a[scores={objective1=1}]

    That's my proposal to achieve that. I'm sorry for commenting so late haha.