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:
- Summon a wither with no AI
/summon minecraft:wither ~ ~ ~ {NoAI:1b} - Modify its data to be empty
/data modify entity @e[type=wither,limit=1,sort=nearest] DeathLootTable set value ""
- 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.