Mojira Archive
MC-149589

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

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.

Unresolved

[Mod] Jiingy

Tetrajak

2019-04-25, 05:22 AM

2024-12-28, 12:57 PM

36

19

Confirmed

Normal

Platform

Loot tables

drop-item, loot-table, loot_table, wither

Minecraft 1.14 - 1.21.4Minecraft 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, 1.21.4

-