Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-190055

The block field of the location_check condition is checked after the block is destroyed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.15.2, 1.16 Pre-release 7, 20w30a, 1.16.2 Release Candidate 1, 1.16.2, 1.17, 1.18.1, 22w13a, 1.19.2, 1.20.4, 24w13a
    • None
    • Confirmed
    • Data Packs, Loot tables
    • Low
    • Platform

      The block field of the location_check condition in a block loot table is checked after the block is destroyed.

      To Reproduce

      1. Create the following loot table in a data pack under data/minecraft/loot_tables/blocks/stone.json, or download the datapack MC-190055 data pack.zip:
        {
          "type": "minecraft:block",
          "pools": [
            {
              "rolls": 1,
              "entries": [
                {
                  "type": "minecraft:item",
                  "name": "minecraft:stone",
                  "conditions": [
                    {
                      "condition": "minecraft:location_check",
                      "predicate": {
                        "block": {
                          "block": "minecraft:stone"
                        }
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
        
      2. Go to survival mode and mine a stone block.
        • No block is dropped.
      3. Change the "block": "minecraft:stone" part to "block": "minecraft:air"
        • A stone item is dropped.

      The condition is checked after the block is destroyed, making it impossible to check the NBT data of the destroyed block in block loot tables.

            Unassigned Unassigned
            SPGoding [Mod] SPGoding
            Votes:
            17 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              CHK: