Hey y'all, I'm redoing a skills system and each skill is activated differently. Up until now, I handled events by checking which skills are listening which events and then firing the methods from the skills that handle the event that was triggered. Now, I've noticed that other plugins just register a listener per skill. Do lots of listeners, say, 50 skills - so 50 listeners a plugin, have a dramatic effect on the server's tick p/s or cpu/ram usage? I haven't had a chance to test. Thanks!
Bartoke why not one listener that checks the active skill / which item the player is holding and act accordingly?
I would do something like this: Code:java @EventHandlerpublic void onItemSwitch(PlayerItemHeldEvent event) { Material material = event.getPlayer().getInventory().getItem(event.getNewSlot()).getType(); switch(material) { case STONE: handleSpellStone(); case DIRT: handleSpellDirt();...