Unable to modify PhantomBot.class file


PhantomBot Version: v2.3.8
OS Version: Windows 10
Java Version: Java 8
Browser and Version (for Panel Support): Chrome - Version 60.0.3112.90 (Official Build) (64-bit)
Stock PhantomBot: Yes/No Yes

So I’m in the phantombot.jar file, I’m trying to modify some code within, i’m using a java decompiler program, and when I try to access the the PhantomBot.Class file from Phatombot.jar/tv.pahtombot, its giving me an internal error. Is this file locked?


Why are you using a decompiler? The source for the bot is on Github.


I have on idea, im just going taking it as it goes. I have no idea on scripting or coding. I’m just trying to make a modification. Not just that, learn how to do it, as well.


Well, 99% of users will never need to touch the core. The vast majority of modifications can be handled by editing an existing script, or making a new one. You’ll obviously need to know Java/Javascript, in addition to Rhino.

If you don’t know the languages the bot uses, I suggest learning them first as PhantomBot (and bots in general) are not the easiest way to learn a language. Source is located on our Github, we have a basic development environment setup guide on there I’d recommend looking at.


Gotcha. The only thing i’m trying to do is, modify the Baseport + 3 and Baseport + 4 line of code. I was wanting an editor to make that change.


So there is no way to just pull out the .class file and make the edit there and save the changes. I would have to go to github, copy the source file there and convert, and add it back into the .jar file.

Can it be done though, by just pulling out the .class file and editing it. If so, what program would I use?


No, you cannot simply just pull out a .class file, make changes, and stick it back in. That’s simply just not how this works.

For editing .java files; I highly recommend using an IDE (Integrated Development Environment). Yes, even for this simple change.

Why? Well, you can rebuild the .jar file in a single click using one. So that means you can make your modifications, click, boom, new modified jar.

The devs were nice enough to include multiple setup guides for different IDEs.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.