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

Obscure script API crash regarding dimension-run commands.

XMLWordPrintable

    • Unconfirmed
    • iOS

      I found a very specific bug regarding the Minecraft Server-API (1.12.0-beta).

      If the execute command is run on a dimension & the command run by the execute command fails THEN the game will crash.

      Expected Behavior:

      Command silently fails.

      Observed Behavior:

      Game crashes if: 1. Command run on a dimension 2. Command is an execute command 3. The chained command fails

      All three criterea must be met for the game to crash as seen in my example video.

      How to reproduce:

      Run "dimension.runCommand(<cmd>)" in a script with any command that fulfills the crash condition. Command used in my example: "execute run give @a[hasitem=

      {item=stick}

      ] apple" (no target found, so the command failed).

      Alternate way to reproduce:

      Download the “MCPE-185196” mcaddon file, install it on a version of Minecraft that supports the 1.12.0-beta server API, enable it on a world with beta APIs, then click/use the brick item to crash the game. Look into the main.js file in the add-on & you will see all that it is doing is running the failing command on the dimension.

       

      Workaround:

      For anyone who needs a workaround, you can effectively run a command on a dimension without directly running with .runCommand method. You can do this by summoning an entity in the dimension, running the command on the entity, then removing the entity in the same tick. Here is what I use:

      let dummy = Context.dimension.spawnEntity('minecraft:snowball', Context.location);
      dummy.runCommand(cmd);
      dummy.remove();

        1. MCPE-185196.mcaddon
          1.0 kB
          PhosXD
        2. RPReplay_Final1723495854.mp4
          8.78 MB
          PhosXD

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

              Created:
              Updated: