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