register event spigot code example Example: register listener spigot getServer().getPluginManager().registerEvents(new Listener(), this);