Vein Miner

Vein Miner

263k Downloads

Could not pass event BlockBreakEvent to VeinMiner v1.17.8

rlane85 opened this issue ยท 3 comments

commented

I've been upgrading plugins to Spigot 1.17 on my private server. Noticed Veinminer wasn't working and found this stack trace in console:

[03:21:17] [Server thread/ERROR]: Could not pass event BlockBreakEvent to VeinMiner v1.17.8
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.server.level.PlayerInteractManager.breakBlock(PlayerInteractManager.java:338) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:298) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:268) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1478) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.network.protocol.game.PacketPlayInBlockDig.a(SourceFile:34) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.network.protocol.game.PacketPlayInBlockDig.a(SourceFile:8) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:30) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.util.thread.IAsyncTaskHandler.executeTask(SourceFile:151) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.util.thread.IAsyncTaskHandler.executeNext(SourceFile:125) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.server.MinecraftServer.bg(MinecraftServer.java:1124) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.server.MinecraftServer.executeNext(MinecraftServer.java:1117) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.util.thread.IAsyncTaskHandler.executeAll(SourceFile:110) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.server.MinecraftServer.sleepForTick(MinecraftServer.java:1100) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1030) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:307) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.NoSuchMethodError: 'boolean org.bukkit.entity.Player.breakBlock(org.bukkit.block.Block)'
at wtf.choco.veinminer.utils.ReflectionUtil.breakBlock(ReflectionUtil.java:52) ~[?:?]
at wtf.choco.veinminer.listener.BreakBlockListener.onBlockBreak(BreakBlockListener.java:183) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor26.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot_1.17.jar:3100-Spigot-c9cea60-5182f92]
... 21 more

commented

I was able to re-create the issue in Spigot Build 3100, however, with updating of the spigot server, the plugin will work normally. Try updating the server? This is cause of method boolean org.bukkit.entity.Player.breakBlock(org.bukkit.block.Block) being newly introduced in Spigot 1.17 API.

Note that Player#breakBlock is introduced in these changes:
Build 3114 - Implementation of breakBlock
Build 3126 - Additional Validation of breakBlock
Therefore, is recommended to run Spigot Build with at least a version of 3114 and onwards. You can check your spigot build with /version. It will show something like this.
"This server is running CraftBukkit version 3xxx-Spigot..." with 3xxx being the server version.

commented

ok, thanks. I upgraded to 1.17 but maybe not the right build number

commented

Yep. Just update your server. That's it