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
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
I also tested in 1.12.0.4 and see the same behavior.