MrKinau / FishingBot

1.8 - 1.21 Fishing bot for Minecraft
GNU General Public License v3.0
322 stars 68 forks source link

Bot too slow! and other errors, what's causing this? #2

Closed eightyninetytwo closed 5 years ago

eightyninetytwo commented 5 years ago

I'm constantly getting these errors:

What's causing these errors? The server is not shutting down, all other clients are unaffected.

Edit: New issue arose, this is the output: Exception in thread "main" java.lang.NoClassDefFoundError: javafx/util/Pair at systems.kinau.fishingbot.network.protocol.play.PacketInEntityMetadata.readNBT(PacketInEntityMetadata.java:512) at systems.kinau.fishingbot.network.protocol.play.PacketInEntityMetadata.readWatchableObjects_1_14(PacketInEntityMetadata.java:131) at systems.kinau.fishingbot.network.protocol.play.PacketInEntityMetadata.defaultLoop(PacketInEntityMetadata.java:89) at systems.kinau.fishingbot.network.protocol.play.PacketInEntityMetadata.read(PacketInEntityMetadata.java:48) at systems.kinau.fishingbot.network.protocol.NetworkHandler.readPacket(NetworkHandler.java:411) at systems.kinau.fishingbot.network.protocol.NetworkHandler.readUncompressed(NetworkHandler.java:362) at systems.kinau.fishingbot.network.protocol.NetworkHandler.readData(NetworkHandler.java:337) at systems.kinau.fishingbot.FishingBot.connect(FishingBot.java:142) at systems.kinau.fishingbot.FishingBot.start(FishingBot.java:104) at systems.kinau.fishingbot.Main.main(Main.java:12) Caused by: java.lang.ClassNotFoundException: javafx.util.Pair at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 10 more

My guess is that the game sees something that it can't detect, or understand, so it quits. That's my BEST guess though, please help LOL :)

MrKinau commented 5 years ago

Hey @SpicyTorchic

thanks for your issue. First: The "Bot is slow (Maybe stuck). Trying to restart!" is quite normal, if the bot doesnt fish anything in 60 seconds (I think) it retries, because sometimes Minecraft doesnt realizes that the bot already threw the fishing rod.

Second: "Could not receive packet! Shutting down!" Dunno why this happens to you. Which MC-Version do you use? How often does it happen? Cant investigate it cause I'm on vacation, but will done it if I'm back home.

Third: The error ouccrs, cause I used some parts of javafx (mainly its for graphical user interfaces) it could be that you have a java version installed, without javafx?

hope I could help you and would be nice to hear more from You

eightyninetytwo commented 5 years ago

Well, I fixed the bot is too slow issue, the biggest problem was that I was using this afk fishing build for it, and the trapdoor and noteblock was messing with it for some reason: https://youtu.be/t665N_maRYg

Placing the bot in front of just a 1x1 of water worked much better.

As for the bot shutting down, I believe I fixed it, I'm not quite sure how, it was quite a rare error anyway. The servers version though is 1.13.2

The last error seems to be the only one causing issues at the moment. I am running the bot on lubuntu, which is a lightweight version of Ubuntu that is definitely known for missing quite a few libraries and things that normal Ubuntu would have, also might be that I'm running it on Linux, and Java versions on Linux are a little funky like that. I'm about to go on vacation myself, so you might not here from me for awhile, but I'll look into the Java versions that's running on my machine, and see what's up.

Thank you for your feedback, I'd love to hear more. Thank you for this awesome piece of software :)

eightyninetytwo commented 5 years ago

It doesn't seem like I could find any fixes, I manually installed JavaFX and I tried using OpenJDK 8, instead of 11, didn't work, any suggestions?

MrKinau commented 5 years ago

OK the javafx things are quite messed up with java 11, I will remove the javafx stuff from the code, cause it seems to be a quite common bug with java 11. I've only tested it on Java 8

Before the Shutting down message, there should come a stacktrace like you sent. Is this the same error or it is some different?

MrKinau commented 5 years ago

With my latest commit: https://github.com/MrKinau/FishingBot/commit/bd5ba5eac965e560bdbc9a5a8c05f91e6dcf6b7c

I replaced all javaFX related stuff. Maybe the latest release works better for you: https://github.com/MrKinau/FishingBot/releases/latest

eightyninetytwo commented 5 years ago

@MrKinau I will try it out now, I will be leaving again for another trip shortly, will do more testing then

Edit: Thank you so much! The bot works flawlessly with that update! Seems as if my linux build does not work well with the javaFX related stuff! I haven't had a single error since, thank you very much for your work! This was a fun project for me :)

MrKinau commented 5 years ago

Nice to hear this, thanks for your issue, feel free to create new ones if you have suggestions or find bugs ;)