Rosewood-Development / RoseStacker

A next-generation stacker plugin for Spigot and Paper servers
Other
137 stars 35 forks source link

PreDropStackedItemsEvent not firing #111

Closed GeorgeV220 closed 2 months ago

GeorgeV220 commented 3 months ago

Hello!

I'd like to propose an enhancement: the addition of a StackedItemSpawnEvent. Here's the rundown:

Purpose:

Looking forward to your thoughts on this!

Esophose commented 3 months ago

This one? https://github.com/Rosewood-Development/RoseStacker/blob/master/Plugin/src/main/java/dev/rosewood/rosestacker/event/PreDropStackedItemsEvent.java

GeorgeV220 commented 3 months ago

OMG I had not noticed this event, I'm sorry. Thank you very much!!

GeorgeV220 commented 3 months ago

Hello again, I'm reopening the issue because PreDropStackedItemsEvent is not being fired at all. When listening to this event, no console output appears when I drop stacked items or spawn them with commands. The listener is registered using Bukkit.

@EventHandler
public void onStackSpawnEvent(PreDropStackedItemsEvent event) {
    Bukkit.getLogger().info("test");
    Bukkit.getLogger().info(event.getItems().toString());
}

RoseStacker version: 1.5.20 Server version: git-Purpur-2176 (MC: 1.20.4)

Esophose commented 3 months ago

The event only fires when groups of items are being dropped by rosestacker all at once, such as for when you kill a whole stack of entities at once. If you want to be able to detect all items dropping you should also listen to the EntitySpawnEvent for item spawns like normal