[SPIGOT-7801] Dying players drop items with wrong pickup delay (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

Issue Links:
Relates
relates to SPIGOT-7800 Dying players drop items at wrong pos... 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, the items they drop can't be picked up by players for exactly 40 ticks (2 seconds). In Spigot, this is reduced to 10 ticks (0.5 seconds).

You can verify this by placing a repeating command block (obtained using /give @s minecraft:repeating_command_block), and pointing it into a chain command block (/give @s minecraft:chain_command_block), pasting the following commands into them.

# Repeating:
execute if entity @e[type=item] run tellraw @a {"entity":"@e[type=item]","nbt":"PickupDelay"}

# Chain:
kill @e[type=item]

Then power the repeating command block with a lever, and die with an item in your inventory. This will print the item's PickupDelay NBT value in chat. In vanilla, it's 40s. In Spigot, it's 10s.

One reason this matters is that data packs in vanilla can use this to detect whether items at a player's death position were more likely dropped by a player's death (and aren't just there by coincidence) by checking for Age:0s and PickupDelay:40s together. Age:0s alone isn't enough because, for example, items from droppers have Age:0s but PickupDelay:0s. In Spigot servers, this distinction can't be relied on, so 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 ]

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

 

Comment by Grant Gryczan [ 26/Jun/24 ]

Possibly relates to SPIGOT-7800 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:54:51 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.