mojira.dev
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.

Attachments

Comments 2

I also tested in 1.12.0.4 and see the same behavior.

Cleaning up old tickets: This ticket has not been updated recently (~1 year+) so is being closed as Cannot Reproduce. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

mrflippy

(Unassigned)

203931 / 203136

Unconfirmed

Windows

Windows 10 Pro - Version 10.0.17134 Build 17134

1.12.0.3 Beta, 1.12.0.4 Beta

Retrieved