Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-166279

@initiator not working on NPCs in /execute commands

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.19.51
    • None
    • Confirmed
    • Windows

      When running /execute chain commands in an NPC, the NPC fails to recognize @initiator.
      Based on the setup logic, when attempting run run command below, the command should run properly.

      /execute if entity @p[x=-39,y=207,z=27,dx=-39,dy=207,dz=27] run /title @initiator actionbar §c§lSlots in Use...§r

      This command is setup to give the title in the actionbar stating "Slots in Use" if someone is standing at the coordinates in the first part of the command. The problem that I am encountering is the command will not run correctly because me (the initiator) is not being recognized, so I have had to use @p to the closest player.

      I believe based on the logic of @p and the location relevant to @p is nearest to the NPC, the game should be programed to recognize me as @initiator as I am the person who initiated the command.

      TL:DR @initiator doesn't work in NPCs using /execute commands

      Full NPC command input:
      /execute if entity @p[x=-39,y=207,z=27,dx=-39,dy=207,dz=27] run /title @initiator actionbar §c§lSlots in Use...§r
      /execute unless entity @p[x=-39,y=207,z=27,dx=-39,dy=207,dz=27] run /title @initiator[scores=\{Crates=!1}] actionbar §c§lYou don't have a Crate Key...§r
      /execute unless entity @p[x=-39,y=207,z=27,dx=-39,dy=207,dz=27] run /title @initiator[scores=\{Crates=1..}] actionbar §b§lPress the Button to Spin...§r
      /execute unless entity @p[x=-39,y=207,z=27,dx=-39,dy=207,dz=27] run /tp @initiator[r=5,scores=\{Crates=1..}] -39 207 27

      Again, since @initiator isn't working, I had to replace it with @p.

      Thanks!

            WithheldTaxes WithheldTaxes
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: