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

Setting blockstates outside of expected range via scripting appears to cause memory corruption

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • None
    • 1.12.0.3 Beta, 1.12.0.4 Beta
    • None
    • Unconfirmed
    • Windows
    • 203931 / 203136

      Setting a blockstate value to a value outside of the expected range appears to corrupt memory.

      Example:

      Block: "minecraft:redstone_wire"

      Blockstate property: "redstone_signal"

      I tested setting this property with the following values:

      • -10: Appears to set, no obvious abnormal behavior
      • -1: Appears to set, no obvious abnormal behavior
      • 0-15: Sets redstone level as expected
      • 16+: Unexpected behavior: May change the block type to a completely different block. May also crash minecraft

      The code I used is:

      let blockstates = this.getComponent(block, "minecraft:blockstate");
      blockstates.data.redstone_signal = 16;
      this.applyComponentChanges(block, blockstates);

      I have attached an example mcworld and behavior mcpack with the scripts. The blockstate test is hooked into the onBlockDestructionStarted event. To test, load the world, stand next to some redstone wire and then attack the ground at your feet.

            mrflippy mrflippy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: