Open EpicPlayerA10 opened 3 weeks ago
the velocity for drops has already been applied to the items in that list, mutating it would just be adding new entities into the list (with unexpected behavior)
Look what i mean: https://www.youtube.com/watch?v=SHTbn83wJHc . You can clearly see in this video that custom drop (diamond) is not spreading that far as other items that were in my inventory.
Yes, I know what you mean. Adding entities to that list will not go back and run them through the spreading logic, adding entities to that list can also result in unexpected behavior with other plugins do to the implementation (i.e. plugins can't just "remove" items from the list as they usually could)
But there is some kind of mutation handling. When I remove item from that list it will just not drop. All items that are dropped (custom drops and normal drops like inventory) happens here: https://github.com/PaperMC/Paper/blob/bd5867a96f792f0eb32c1d249bb4bbc1d8338d14/patches/server/0932-Restore-vanilla-entity-drops-behavior.patch#L235-L242
There must be something going on with this runConsumer
then.
Oh yeah, i see. When I add custom drop to PlayerDeathEvent#getDrops
then the Entity.DefaultDrop
's value dropConsumer
is set to null. https://github.com/PaperMC/Paper/blob/bd5867a96f792f0eb32c1d249bb4bbc1d8338d14/patches/server/0932-Restore-vanilla-entity-drops-behavior.patch#L188
And when dropConsumer
is null then in this logic it will drop item in the player's location as a fallback. So the spreading is not applied because the dropConsumer
applied that spreading and for some reason it is set to null when adding custom drop. https://github.com/PaperMC/Paper/blob/bd5867a96f792f0eb32c1d249bb4bbc1d8338d14/patches/server/0932-Restore-vanilla-entity-drops-behavior.patch#L69-L73
Expected behavior
Custom drops added via
PlayerDeathEvent#getDrops
should spread on the ground as far as the dropped inventory.Observed/Actual behavior
Custom drops are dropped in player location without spreading it.
Steps/models to reproduce
/kill
command)Plugin and Datapack List
Paper version
[16:22:56 INFO]: Checking version, please wait... [16:22:56 INFO]: This server is running Paper version 1.20.6-137-master@bd5867a (2024-06-04T21:04:28Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT) You are running the latest version Previous version: 1.20.6-115-9d6f2cc (MC: 1.20.6)
Other
No response