User Tools

Site Tools


mod_development:decompiling

This is an old revision of the document!


Preface

Minecraft uses a programming language called Java. The advantages of this are that it works on many kinds of systems and that it is fairly easy to decompile and modify. All(?) the Minecraft code is stored inside a JAR file (Java ARchive) which contains class files (compiled JAVA files). These class files are obfuscated which means that the purpose of the code within has been concealed. This code must be decompiled and deobfuscated in order to be modified. 1)

Requirements

  • JDK (Java Development Kit). Version 8 is recommended.

One of:

  • LTS (MCP with Long Term Service). Recommended.
  • MCP (Minecraft Coder Pack) Use this if LTS doesn't support the version you are using or doesn't work for some other reason.

Instructions

After installing JDK, follow the instructions below depending on your choice of coder pack.

LTS

  1. Export your LTS-master.zip to somewhere sensible (this will contain all your development files).
  2. In the newly exported folder, run setup.bat or setup.sh depending on your OS (Use .bat on Windows).
  3. Enter 'y' in the newly opened console to confirm the action.
  4. Choose the version you wish to compile by entering it's name.
  5. After it is finished you may need to refresh the folder to see the new files.
  6. (Optional) If decompiling a mod, apply it to the relevant jar in the jars folder.
  7. Run the decompile.bat/sh file that has generated.

MCP

TODO

1)
You can edit class files directly with bytecode editing but this is a difficult alternative only useful in certain circumstances.
mod_development/decompiling.1573710164.txt.gz · Last modified: 2019/11/14 05:42 by rek

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki