Mojira Archive
MCPE-46011

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

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.

Cannot Reproduce

mrflippy

2019-05-08, 07:58 PM

2020-05-13, 12:12 PM

2020-05-13, 12:12 PM

0

1

Unconfirmed

203931 / 203136

1.12.0.3 Beta, 1.12.0.4 Beta

-