mojira.dev
MC-94610

Missing loot table entries for mob heads from charged creepers

The bug

Loot tables do not contain items that are dropped under certain circumstances.

Affected mobs

  • Creeper: Music discs Fixed as of 18w43a

  • Mob heads dropped from mobs killed by charged creeper

This requires additions to the loot table system to be fixed.

Linked issues

Attachments

Comments

Brian McNamara

Witch potions are held items, like when a zombie holds a sword, so not part of loot tables. The others are arguably bugs though, since loot tables could express them now, I think.

Brian McNamara

As in the related bug, mob heads (from electrified creepers) arguably also should be in tables...

Oh wait, tables only have killed_by_player conditions, so music discs and mob heads cannot be expressed. (And possibly witherboss drop has some magic explosion-protection, so perhaps this is all WAI for now.) It would be nice if they 'finished' the loot tables feature so all drops were expressed, but that seems unlikely.

Skylinerw

@@unknown, Concerning WitherBoss: the nether star items themselves are always explosion-proof regardless of where they came from.

Tokes

Villagers don't have a loot table at all!

marcono1234

You are right, but this is probably a different bug. You should probably create a new report for this.
It is MC-95450

Michael

Yes for 17w16a
Creepers could test to see if the conditions were "killer" and properties name was minecraft:skeleton, perhaps. For mob heads each loot table would need to be modified to test if the "killer" was a creeper with a "powered" property of true.

Benjamin Sembel

If the set_nbt loot table function would be able to modify the tags of the direct_killer, the attached file 

[media]

would work exactly like it should.

With the current state of loot table functions it is not possible to prevent multiple head drops from the same creeper.

muzikbike

I believe that jungle fishing is also missing, correct me if i'm wrong though.

Benjamin Sembel

Confirmed in 1.16.1

KirbAvion

Confirmed for 1.17.1.

MMK21

Affects 1.18

MMK21

Affects 1.18.1

KirbAvion

Affects 22w12a.

Avoma

Can confirm in 1.19.2. Here's a code analysis of this issue.

Code Analysis:

The following is based on a decompiled version of Minecraft 1.19.2 using Mojang mappings.

This is happening because the drop of a mob head from the death of a charged creeper explosion is controlled by the dropCustomDeathLoot() method which is present within the classes of all mobs that are able to drop their heads upon being killed by a charged creeper explosion. Because the drops are controlled this way, they don't have loot table entries, therefore resulting in several issues such as the given mob always dropping its head despite having an assigned "DeathLootTable" NBT tag.

marcono1234

(Unassigned)

Confirmed

Platform

Low

Loot tables

creeper, head, loot, loot-table, music_disc, skull

Minecraft 15w51b, Minecraft 1.10.2, Minecraft 16w42a, Minecraft 16w43a, Minecraft 1.12, ..., 1.17.1, 1.18, 1.18.1, 22w12a, 1.19.2

Retrieved