mojira.dev
MCPE-226777

Bedrock Loot Table Misfire with Empty Hand

So I am attempting to create a mod, behavior pack with resource pack and all that. I have a block, quartz, that has an attached loot table. Here is the JSON for the block:

{
  "format_version": "1.21.100",
  "minecraft:block": {
    "description": {
      "identifier": "rocksandstuff:quartz"
    },
    "components": {
      "minecraft:geometry": "geometry.quartz",
      "minecraft:material_instances": {
        "*": { "texture": "rocksandstuff_quartz", "render_method": "opaque", 
              "minecraft:item_visual": {"material_instances": { "texture": "rocksandstuff_quartz_item", "render_method": "opaque"}}
              }
        },
      "minecraft:destructible_by_mining": { "seconds_to_destroy": 1.5 },
      "minecraft:loot": "loot_tables/blocks/quartz_strict.json"
    },
    "tag:minecraft:stone_pick_diggable": {}
  }
}

and here is the JSON for the loot table

{
  "pools": [
    {
      "rolls": 1,
      "entries": [
        { "type": "item", "name": "minecraft:potato",
          "conditions": [ { "condition": "match_tool", "item": "minecraft:iron_pickaxe" } ] },

        { "type": "item", "name": "minecraft:carrot",
          "conditions": [ { "condition": "match_tool", "item": "minecraft:stone_pickaxe" } ] },

        { "type": "item", "name": "minecraft:grass",
          "conditions": [ { "condition": "match_tool", "item": "minecraft:golden_pickaxe" } ] },

        { "type": "item", "name": "minecraft:ladder",
          "conditions": [ { "condition": "match_tool", "item": "minecraft:diamond_pickaxe" } ] },

        { "type": "item", "name": "minecraft:stick",
          "conditions": [ { "condition": "match_tool", "item": "minecraft:netherite_pickaxe" } ] },

        { "type": "item", "name": "minecraft:air",
        "conditions": [ { "condition": "match_tool", "item": "minecraft:air" } ] }
      ]
    }
  ]
}

firstly, there doesn’t seem to be any documentation on dealing with the condition that a block is broken with an empty hand. Whether that is because these conditions are intended to exclude the empty hand automatically, or some other reason, that is a rather frustrating aspect of this.

Secondly, I am attempting to make a custom stone-like block. It should only drop its respected item when broken with the right tier of pickaxe. I have tried many alterations of the match_tool condition. Whenever the block is broken with an empty hand, it just fires a random condition. As you can see, I attempted to check for the minecraft:air object, however that changes nothing. I have also checked for “undefined”, with the same results.

I have a script that prints to the content log and the in-game chat.

import { world, EquipmentSlot } from "@minecraft/server";

world.beforeEvents.playerBreakBlock.subscribe((ev) => {
  const eq = ev.player.getComponent("equippable");
  const held = eq?.getEquipment(EquipmentSlot.Mainhand);

  // Send to in-game chat
  ev.player.sendMessage(`Mainhand: ${held?.typeId}`);

  // Print to Minecraft's log file
  console.warn(`Player ${ev.player.name} broke ${ev.block.typeId} with: ${held?.typeId}`);
});


I am unsure if I simply have something wrong, however from reviewing your documentation: https://learn.microsoft.com/en-us/minecraft/creator/documents/loottableconditions?view=minecraft-bedrock-stable , it appears that this may be a bug.

Any help is appreciated!
Also if you would like to see any other scripts or files, please let me know and I would be glad to provide them for you.

Comments 1

Have you asked for help from an addon community for these issues? It sounds like you have multiple issues and are not sure about what parameters are supported.

A bug report should focus on a single issue that you have a reasonable expectation is not working as it should. For issues with the addon system we need you to attach a sample pack that we can use to reproduce the issue and clearly state expected and observed results.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Noah G

(Unassigned)

Unconfirmed

Windows

Windows 11 24H2

1.21.100

Retrieved