Status: Resolved (View Workflow)
Affects Version/s: None
Fix Version/s: None
Linux x86_64, Java 8, 12
Spigot versions from at least the last 5 or 6 months, potentially a lot longer.
Single test plugin.
Source code and Maven build script provided: https://github.com/totemo/TestDropChances
Version:git-Spigot-065a373-6ed8a18 (MC: 1.14.4) (build 2459)
Spigot CraftEntityEquipment deliberately decreases drop chances by 0.1 on set and adds 0.1 on get.
You can use the provided test plugin (https://github.com/totemo/TestDropChances) to spawn mobs with known armour and hand drop chances.
If you spawn mobs with `/testdropchances 0.099` note that they will not drop their equipment on death ever when killed with a non-looting sword.
The NBT fields of the mob are incorrect by the 0.1 offset, as can be verified by vanilla commands:
When the mob dies, these 0.1 offsets are not taken into account by CraftBukkit n.m.s.EntityInsentient.dropEquipment() and Spigot-Server n.m.s.EntityInsentient.dropDeathLoot().
The relevant drop chance arrays are initialised to expected vanilla drop chances:
This is the situation in the current build but also applied about 5 or 6 months ago in Spigot 1.13.2. I didn't follow up on it at the time thinking it was a temporary situation.
The offsets in CraftEntityEquipment are clearly deliberate, but I would liken them to junk DNA. Taking them out would probably resolve this.