[SPIGOT-7800] Dying players drop items at wrong position (breaking data packs that detect these items) Created: 26/Jun/24  Updated: 25/Dec/24  Resolved: 29/Jun/24

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

Type: Bug Priority: Minor
Reporter: Grant Gryczan Assignee: Doc
Resolution: Fixed Votes: 0
Labels: None

Attachments: PNG File image-2024-06-26-02-33-03-954.png    
Issue Links:
Problem/Incident
causes SPIGOT-7816 Regression: Dying players drop their ... Resolved
Relates
relates to SPIGOT-7801 Dying players drop items with wrong p... Resolved
relates to SPIGOT-7806 Drops in PlayerDeathEvent and EntityD... Resolved
Version: CraftBukkit version 4195-Spigot-fcd94e2-f057cf4 (MC: 1.20.6) (Implementing API version 1.20.6-R0.1-SNAPSHOT), CraftBukkit version 4242-Spigot-0a642bd-515fe49 (MC: 1.21) (Implementing API version 1.21-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

When a player dies in vanilla, their items drop at exactly 0.3 blocks below their eyes. This is true regardless of the player's scale attribute--items of larger players drop farther up from their feet.

(It's very important to note this is NOT true of the player's XP or their loot table. Both XP and loot table items in vanilla do drop at the player's feet.)

When a player dies in Spigot, their items drop at their feet instead of the vanilla position. You can test this by standing on the ground and running the following commands in order with items in your inventory. Don't move between running these.

/fill ~-2 ~-1 ~-2 ~2 ~2 ~2 glass hollow
/fill ~-1 ~ ~-1 ~1 ~1 ~1 white_carpet
/kill

On a vanilla server, the items land on the top layer of carpets. But with this bug, they land on the bottom layer.

One reason this matters is that data packs in vanilla can reliably detect what items the player dropped by checking for the item entities at the position 0.3 blocks below their eyes in the same tick they died. But in Spigot servers, this doesn't work, and the items aren't detected. This breaks the latest version of the Graves data pack from Vanilla Tweaks, for example.



 Comments   
Comment by Doc [ 28/Jun/24 ]

Ok i check and currently CraftBukkit call the custom method for drop this method modify the position of spawn (causing this) and also modify the pickup delay related to SPIGOT-7801

i make a PR for make the drops use the NMS method for allow keep the vanilla behaviour.

PR: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1437/overview

You can test this PR using BuildTools (recommend use the executable): https://www.spigotmc.org/wiki/buildtools/

Comment by Grant Gryczan [ 26/Jun/24 ]

Possibly relates to SPIGOT-7801 as these are both cases of a player's drops on death having non-vanilla properties. It's likely both are caused by the same underlying issue.

Generated at Tue Apr 22 04:41:52 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.