mojira.dev
MCPE-108344

Game crashes when a custom block spawns loot (from an event) when broken

I've been experimenting with the new block components today. One of them being the "minecraft:on_player_destroyed" component. When said block is destroyed, an event plays that triggers a randomizer (Randomizer A in this case to prevent confusion), which picks a few options. When Randomizer A picks the third option (it is set to 100 weight so it is more likely), which is another randomizer (Randomizer B), it picks one of four options, each which "spawn_loot". I used the sheep, chicken, pig, and cow loot table in this case. When in game, destroying the block causes the game to crash half of the time.

Steps to Reproduce:
1. Make an add-on with a custom block with the following code (this is my code):
{
"format_version": "1.16.100",
"minecraft:block": {
"description": {
"identifier": "wacky:wacky_block"
},
"components": {
"minecraft:display_name": "wacky:wacky_block",
"minecraft:unit_cube": {},
"minecraft:destroy_time": 0.85,
"minecraft:on_player_destroyed": {
"event": "lucky_block_break"
}
},
"events": {
"lucky_block_break": {
"randomize": [
{
"run_command": {
"command": [
"setblock ~ ~ ~ diamond_block"
]
}
},
{
"run_command": {
"command": [
"give @p stick 1"
]
}
},
{
"run_command": {
"command": [
"clone ~ ~-10 ~ ~5 ~5 ~5 ~ ~20 ~"
]
}
},
{
"randomize": [
{
"spawn_loot": {
"table": "loot_tables/entities/cow.json"
}
},
{
"spawn_loot": {
"table": "loot_tables/entities/pig.json"
}
},
{
"spawn_loot": {
"table": "loot_tables/entities/sheep.json"
}
},
{
"spawn_loot": {
"table": "loot_tables/entities/chicken.json"
}
}
],
"weight": 100
},
{
"run_command": {
"command": [
"summon slime ~ ~2 ~"
]
}
},
{
"run_command": {
"command": [
"execute @p ~ ~ ~ structure load obsidian_trap ~-1 ~ ~-1"
]
}
},
{
"run_command": {
"command": [
"execute @p ~ ~ ~ structure load lava_pit ~-3 ~-50 ~-3"
]
}
}
]
}
}
}
}
2. Destroy the custom block.

Expected Results:
The custom block drops either a cow's, sheep's, pig's, or chicken's death loot table.

Observed Results:
The game crashes. I have tested this three times.

On a side note, the options listed in Randomizer A work perfectly fine (apart from the third one, of course.)

Attachments

Comments 2

Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response.

Is this still an issue in the latest version? If so, can you please add it to the affected versions (or mention it if you are not the reporter)?

This ticket will automatically reopen when you reply.

Cleaning up old tickets: This ticket had been set to 'Awaiting Response', but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.

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

BeeTeeKay

(Unassigned)

Unconfirmed

Windows

1.16.100

Retrieved