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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • None
    • 1.16.100
    • None
    • Survival
    • Unconfirmed
    • Windows

      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.)

            BeeTeeKay BeeTeeKay64
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: