Solved BlockEvent

N4TH4NOT

New member
Oct 8, 2022
3
0
1
I am using the last 1.18.2 paper version and I can't register my event due to BlockEvent. It's a bug ??
Thank in advance.

Stacktrace:
[11:46:35 ERROR]: Error occurred while enabling Bookshelves v1.0.0 (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.block.BlockEvent. Static getHandlerList method required!
at org.bukkit.plugin.SimplePluginManager.getRegistrationClass(SimplePluginManager.java:765) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.getRegistrationClass(SimplePluginManager.java:763) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.registerEvents(SimplePluginManager.java:702) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at fr.fark.bookshelves.vw.BookshelvesEventsHandler.ini(BookshelvesEventsHandler.java:122) ~[fark-bookshelves-1.0.0.jar:?]
at fr.fark.bookshelves.Main.onEnable(Main.java:35) ~[fark-bookshelves-1.0.0.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-388]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-388]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.reload(CraftServer.java:1016) ~[paper-1.18.2.jar:git-Paper-388]
at org.bukkit.Bukkit.reload(Bukkit.java:909) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:54) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.dispatchCommand(CraftServer.java:906) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleCommand(ServerGamePacketListenerImpl.java:2307) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2118) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2099) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundChatPacket.handle(ServerboundChatPacket.java:46) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundChatPacket.a(ServerboundChatPacket.java:6) ~[?:?]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:51) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1400) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:188) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1377) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1370) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:114) ~[?:?]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1504) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1226) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
 

electronicboy

Administrator
Staff member
Dec 11, 2021
118
8
23
18
You can only listen to events that have a HandlerList on them (See the javadocs, they'll either have a getHandlerList() method on them, or in a parent class; Event firing just basically walks up the class hierarchy until it finds a handler list