Jump to content

How do I modify Minecraft classes?


Is.M.L

Recommended Posts

I absolutely need to change a few client classes directly in Minecraft Jar. How do I do that? I already made the changes (which are extremely simple and can't possibly break anything), now I need to compile the .java files to .class files and replace the right ones but their names are weird like aaa.class

Edited by Is.M.L
explaining scope of changes
Link to comment
Share on other sites

In short: You don't. Forge exists to allow compatibility between mods, editing base classes leads to incompatibilities.

 

You can usually achieve what you want in some other way, e.g. with an event or by replacing a field. If you tell us what you're trying to achieve, we can tell you how to do it.

 

It is possible to modify base classes using ASM, but this is highly discouraged and you won't get any help with it here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Thank you. Unfortunately, Forge is not even an option. I want to add functionality to my client directly. And there would be no incompatibilities, because I only add, don't change or remove anything.

Link to comment
Share on other sites

46 minutes ago, Is.M.L said:

Thank you. Unfortunately, Forge is not even an option. I want to add functionality to my client directly. And there would be no incompatibilities, because I only add, don't change or remove anything.

 

If you're not using Forge, why are you asking for help on the Forge forums?

 

If you want to modify the base classes directly, you need to use MCP. Your edits will likely make the mod incompatible with Forge and any other JAR mod that changes the same classes.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

I ask here because it's the only place I know where people who really know about this stuff gather. You are right, though. I shouldn't do it. You never know, I could break a mod that uses ASM to change bytecode in the classes I need to change. As unlikely as this is with the edits I made, it is a possibility, depending on the way the mode does its bytecode manipulation. Then again, said mod would have to be itself very badly written.

Edited by Is.M.L
Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.