Sign in
Skip to main content

Commands let players perform actions and customize gameplay using text-based instructions. Use this topic to share feedback and ideas for improving commands and related tools.

2

"Launcher" selector

1 Comments

Post a new comment:

Please sign in to leave a comment.

Sorted by oldest
  • 1
    Registered User commented
    Comment actions Permalink

    You do have something very similar to this: The current entity selector or @s. It basically executes the command on the sender.

    To change the sender, you can use:
    /execute as (selector) run (command)

    And then inside your command, you use the selector @s. I am not sure if it is possible to pass the selector from one command block to another (for example in your case, the blocks responsible from saying the npc's lines would take the information from the first command block, meaning even if someonr passed by they would have been already assigned to you), but you can use a function (a text file of type .mcfunction inside .minecraft/daves/YourWorld/datapacks/YourDatapack/YourDatapack_data/functions that executes multiple commands at once, so you can do:


    /execute as @p run (function)
    And inside the function use the @s selector.

    It's a little more complicated than that but I am on phone and it would be hard to explain more details, I hope you understand that and good luck with your project.