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

The wither boss will always drops a nether star regardless of its DeathLootTable data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.14, 1.15.2, 20w15a, 1.16 Release Candidate 1, 1.16, 1.16.5, 21w18a, 1.19.2, 1.19.3, 1.19.4 Release Candidate 2, 1.19.4, 1.20.4, 24w07a, 24w12a, 1.21.1, 24w34a, 24w37a
    • Confirmed
    • Loot tables
    • Normal
    • Platform

      The wither boss' loot table is not changed when its DeathLootTable NBT data is modified, resulting in it always dropping a nether star.

      Steps to Reproduce:

      1. Summon a wither with no AI
        /summon minecraft:wither ~ ~ ~ {NoAI:1b}
        
      2. Modify its data to be empty
        /data modify entity @e[type=wither,limit=1,sort=nearest] DeathLootTable set value ""
        
      3. Kill it
        /kill @e[type=wither]
        

      Expected & Observed Results:

      - The wither will drop a nether star, despite having no DeathLootTable NBT data
      - It would not drop anything, as that is what the player intentionally set the DeathLootTable to.
      

      Screenshots/Videos:

       WitherBossDeathLootTable.mp4

      Code Analysis

      The happens because the wither boss has its death loot table "hard-coded", meaning it ignores any loot table entirely.

      Class: net.minecraft.world.entity.boss.wither.WitherBoss // Method: dropCustomDeathLoot // MCP 1.20.2 Mojang Mappings
      
         protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) {
            super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops);
            ItemEntity itementity = this.spawnAtLocation(Items.NETHER_STAR);
            if (itementity != null) {
               itementity.setExtendedLifetime();
            }
         }
      

      Original Description:

      The bug

      Setting the wither's DeathLootTable NBT tag to any given loot table does not stop the wither from dropping a nether star.
      Loot from the loot table set in the DeathLootTable tag drops in addition to the nether star. This was not the case in 1.13.*, where the DeathLootTable tag being set prevented the nether star from dropping.

        1. 2021-05-11_08.55.12.png
          2021-05-11_08.55.12.png
          243 kB
        2. 2021-05-11_08.55.19.png
          2021-05-11_08.55.19.png
          257 kB
        3. 2021-05-11_08.55.28.png
          2021-05-11_08.55.28.png
          236 kB
        4. WitherBossDeathLootTable.mp4
          3.45 MB

            Unassigned Unassigned
            Jingy [Mod] Jiingy
            Votes:
            36 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              CHK: