Fix ItemDespawnEvent not firing when "despawn-time" has been configured for items.#12561
Fix ItemDespawnEvent not firing when "despawn-time" has been configured for items.#12561kcbleeker wants to merge 1 commit into
Conversation
|
This seems like it would cause the event to get called every following tick when cancelled and prevent items past the despawn time from doing their normal tick logic due to the return. As an alternative, we already have the item despawn time option in the spigot config and the alt item despawn rate option in the paper world config that you could use, they are better for items in this case |
|
Yeah, in general this behavior is independent from the default item despawn behavior, which is what that event covers... so I am not sure if putting the event there is the best. This logic is configurable for each server and sets a hard despawn for each entity, which I am not sure should be configured by plugins. Your plugin can listen to this removal by the |
|
Yea, also in favour of not using this (very much vanilla despawn behaviour) event for this purpose. I'll throw this at one more pair of eyes here tho 👍 |
|
Just highlighting in your discussion that the root issue is that the despawn event does not fire, and |
|
Fyi, |
|
Cool. I'm happy to close this then and just use |
While working on this plugin, I found that if I had a
despawn-timevalue configured for "items" other than the default 5 minutes, it would not fire the ItemDespawnEvent, and I could not hook into it.I have built this locally and tested that the fix works, but I'm no expert on the impact to performance or if there's a better way to achieve this.