[SPIGOT-5195] Player loot table does not drop when keepInventory is on Created: 22/Jul/19  Updated: 24/Jul/19  Resolved: 22/Jul/19

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Metamorphic Mike Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: DataPacks, keepInventory, loottable
Environment:

Plugin-free environment, fresh build from buildtools, dropped in the PVP heads datapack into the datapacks directory from http://mc.voodoobeard.com/ for 1.14. 

Turn game mode keepInventory to true


Version: git-Spigot-9de398a-8b09d98
Plugin: N/A
Guidelines Read: Yes

 Description   

Steps to reproduce: Install the player head drop datapack linked in Environment. Set gamemode keepInventory to true. Kill another player.

Expected behavior: A player skull should drop with the skin of the killed player

Observed behavior: No skull drops.

Background:

The PvP Heads datapack (attached) from Voodoobeard makes use of the new loot tables for players in 1.14 and the convenience function MC provides for populating the a player head with a player skin. 

The datapack functions correctly in Vanilla MC when keepInventory is on, but when testing in Spigot, no player heads are dropping on player kills when this setting is turned on.

 

Probably related to these two issues:
https://hub.spigotmc.org/jira/browse/SPIGOT-5071
https://hub.spigotmc.org/jira/browse/SPIGOT-5188

Thank you!



 Comments   
Comment by Metamorphic Mike [ 24/Jul/19 ]

Hey @md_5 thanks for the super fast work on this one. I was testing today and noticed it still wasn't working. I looked through the code and I see where you removed the drops from outside the keepInventory check but it looks like it passes the drops through to 

CraftEventFactory.callPlayerDeathEvent

and in that method it also checks for keepInventory again and returns without dropping any items. 

if (event.getKeepInventory()) {
  return event;
}
Generated at Fri Mar 14 15:03:42 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.