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

Player conditions for chest loot tables don't work when breaking the chest

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.14.4 Pre-Release 5, Minecraft 1.14.4 Pre-Release 6, 1.14.4, 19w34a, 19w35a, 19w36a, 19w37a, 19w38b, 19w39a, 19w40a, 19w41a, 19w42a, 19w44a, 19w45b, 19w46b, 1.15 Pre-release 1, 1.15 Pre-Release 2, 1.15 Pre-release 3, 1.15 Pre-release 4, 1.15 Pre-release 6, 1.15, 1.15.1, 1.15.1 Pre-release 1, 1.15.2 Pre-Release 1, 1.15.2 Pre-release 2, 1.15.2, 20w06a, 20w07a, 20w08a, 20w09a, 20w10a, 20w11a, 20w12a, 20w13a, 20w14a, 20w15a, 20w16a, 20w17a, 20w18a, 20w20a, 20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 3, 1.16 Pre-release 5, 1.16 Pre-release 6, 1.16 Pre-release 7, 1.16 Pre-release 8, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2, 1.16.3, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 21w05b, 21w07a, 21w10a, 21w11a, 1.17, 1.17.1 Pre-release 1, 1.18.2, 22w11a, 1.21.1
    • Confirmed
    • Loot tables
    • Low
    • Platform

      There are two instances in which a chest with loot table generates its 'treasure', when its opened or when its broken, and it is expected that these two instances generate the same items if meeting the same requirements.

      When you use player related conditions (like entity_scores, entity_properties) while opening chests, the conditions work fine. But while breaking chests, these conditions don't work. Other items in the loot table without these conditions are generated anyways.

      It seems like chest loot tables forget to grab the data of the entity that broke the chest, unlike block loot tables that are working fine in this aspect.

      For testing this bug I made a loot table and put it into this datapack: test loot table.zip

      To get a chest with this loot table:

      /setblock ~ ~ ~ minecraft:chest{LootTable:"minecraft:chests/test_loot"}
      /give @p minecraft:chest{BlockEntityTag:{LootTable:"minecraft:chests/test_loot"}} 1

      You will get emeralds if you open the chest while sprinting, but not if you break the chest while sprinting.

      You will get diamonds if you open the chest while having "test" dummy score of 0, but not if you break the chest while having "test" dummy score of 0.

      And you always will get maps because they have no conditions.

       

       

            Unassigned Unassigned
            FACS01 FACS01
            Votes:
            12 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              CHK: