Stop death bounce-back from hijacking the drops - #182
Merged
Conversation
The death drop protection added in 8d88d9a took the items out of the PlayerDeathEvent at NORMAL priority, dropped them by hand, and cleared the drops list. Any plugin that stores death drops - DeathChest, graves, keep-inventory - then ran on an empty event while the items lay on the ground, so with the default bounce-back: true, Border 4.7.0+ silently broke every such plugin. Leave the event alone: note the death spot at MONITOR, after those plugins have decided what happens to the items, and apply the bounce-back tracking to whatever the server then actually spawns, caught through ItemSpawnEvent in the same tick. If another plugin keeps the items, nothing spawns and there is nothing to track. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013RPEWFAQcCivzQqB4L72Bx
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
The death drop protection added in 8d88d9a (4.7.0) handles
PlayerDeathEventat NORMAL priority by taking every item out ofevent.getDrops(), spawning them by hand withdropItemNaturally, and clearing the list.Any plugin that stores death drops — DeathChest, grave plugins, keep-inventory features — runs at a later priority and now sees an empty event, while the items are already lying on the ground. With the default
bounce-back: true, Border 4.7.0+ silently breaks all of them. Tracked down on a live server where DeathChest chests were always empty: a drops-list tracker caughtPlayerListener.lambda$onPlayerDeath$0clearing 5 stacks just before DeathChest ran.Fix
Leave the event's drops untouched:
onPlayerDeathnow runs at MONITOR — after every plugin has decided what happens to the items — and only records the death spot and island for one tick.onDeathDropSpawn(ItemSpawnEvent) applies the existingtrackItembounce-back to items the server spawns that tick near a recorded death spot.If another plugin takes the drops, nothing spawns and there is nothing to track; if the drops survive, they are tracked exactly as before. Vanilla drop behaviour (velocities, despawn timers) is also preserved since the server spawns the items itself.
Testing
dropItemNaturally, spawned death drops get tracked, far-away/no-death item spawns are ignored,bounce-back: falseand empty-drops paths do nothing.🤖 Generated with Claude Code
https://claude.ai/code/session_013RPEWFAQcCivzQqB4L72Bx