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

Commands with Certain Target Selectors in an Mcfunction Files Only Run When Manually Called

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Awaiting Response
    • Affects Version/s: 1.16.221 Hotfix
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Unconfirmed
    • Platform:
      Windows

      Description

      In an mcfunction file, if you have a command (such as the one I tried to use, kill @a[x=2500,dx=100]) with certain target selectors (which I think are at least dx dy and dz), this command will only run in the function when /function is called in-game, and not from tick.json or called by other functions called by tick.json.
      I have proof that this is not my bug because if I call the function manually with /function everything works as intended but if tick.json calls it everything works as intended except these certain lines. I have also tried other commands, which all seem to be affected, and other target selectors, which don't seem to be affected.
      Steps to Reproduce:

      Create a minecraft behavior pack with a func.mcfunction file in BP/functions/:

      tp @a 0 250 0

      scoreboard objectives new time dummy Time

      scoreboard objectives setdisplay sidebar time

      scoreboard players add @a time 1

      kill @a[x=-10,dx=20]

      and tick.json in the same directory:
      {{

      {\{"values": [ "func"]}

      }}

      and then apply this behavior pack to a world and notice how the time on the side goes up but you aren't killed, but if you type the command /function func then it kills you.

        Attachments

          Activity

            People

            Reporter:
            menderelcapBIG Miles Caprio
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: