[SPIGOT-6279] Ability to listen to org.bukkit.event.Event (so all events) with a Listener Created: 15/Dec/20 Updated: 16/Dec/20 |
|
Status: | Open |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Lauriichan | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 0 |
Labels: | None |
Version: | CraftBukkit version git-Spigot-a19903d-5b74714 (MC: 1.16.4) (Implementing API version 1.16.4-R0.1-SNAPSHOT) |
Guidelines Read: | Yes |
Description |
Adding the possibility to register a Listener that listens to all Events. import org.bukkit.event.* public class GlobalEventListener implements Listener { @EventHandler public void onEvent(Event event) { // Do some stuff with the event called } } This can help on certain applications that got for example a module system on their own to provide the ability to hot load certain features or remove them completely or just update them. |
Comments |
Comment by Lauriichan [ 16/Dec/20 ] |
With that I could achieve something like a workaround yeah, didn't notice that method to be honest. And every event that I want to support, for example a third-party plugin event, would need a listener too, or with that dynamic method I would need to extract the event (which bukkit does already) lookup If I already got a listener and then register that listener if not, so that's more a workaround than a good solution in my opinion, don't you think so? |
Comment by Shane Bee [ 15/Dec/20 ] |
Unless there is something I am missing here, this isn't really needed. Which allows you to dynamically handle event listeners without actually knowing the event class at the time of coding. |