[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: |
![]() |
||||||||||||||||||||
Issue Links: |
|
||||||||||||||||||||
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 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 |