Skip to content

Instantly share code, notes, and snippets.

@Pokechu22
Last active March 31, 2024 21:35
Show Gist options
  • Star 99 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save Pokechu22/97bf5bd528eeadef09dcbae8a15b009f to your computer and use it in GitHub Desktop.
Save Pokechu22/97bf5bd528eeadef09dcbae8a15b009f to your computer and use it in GitHub Desktop.
Setting up MCP for newer versions (e.g. 1.12.2)

It's possible to use create an MCP installation for versions of Minecraft where there hasn't been a full MCP release. It takes a little bit of manual setup, but the end result is highly useful.

  1. Download and extract the most recent MCP build from http://www.modcoderpack.com/. (Currently, the latest build is http://www.modcoderpack.com/files/mcp940.zip)

  2. Edit version.cfg in the conf folder, and change ClientVersion and ServerVersion to the version you want (for instance, 1.12.2).

  3. Download the SRG zip for the version you want; these can generally be found at http://mcpbot.bspk.rs/mcp/<version>/mcp-<version>-srg.zip (for example, http://mcpbot.bspk.rs/mcp/1.11.2/mcp-1.11.2-srg.zip) or at http://files.minecraftforge.net/maven/de/oceanlabs/mcp/mcp/<version>/mcp-<version>-srg.zip (for example, http://files.minecraftforge.net/maven/de/oceanlabs/mcp/mcp/1.12.2/mcp-1.12.2-srg.zip). (For 1.12.1 and 1.12.2, only the minecraftforge link works)

  4. Extract that zip into the MCP conf folder, overwriting files and the contents of the patches folder.

  5. Download the latest daily mappings from http://export.mcpbot.bspk.rs/. Even if they aren't for exactly the version you want, they will generally work.

  6. Extract the mapping zip into the MCP conf folder, overwriting files.

  7. Run MCP's decompile.bat as you normally would.

Note that for this to work, there must be a released SRG file for the version you want. The SRG file is what converts obfuscated names into an intermediate step where names are (mostly) the same between versions; the mappings files convert those intermediate names into the names you see and are used to.

Note that as always, the MCP license applies, even for development builds. Please read the LICENSE.txt included with MCP for more information about what you are and are not permitted to do.

An additional note: if you're using eclipse, you will need to manually fiddle with build paths due to updated libraries. You will also need to attach the native libraries, found in jars/versions/${VERSION}/${VERSION}-natives, to the libraries (e.g. LWJGL) for the game to launch.

@anonyco
Copy link

anonyco commented Apr 28, 2020

@RKvilt Throw off the oppressive chains of Microsoft and switch to Linux. Join the master race. For those most severely harmed by Windows OSes, I recommend Linux Mint, as it's one of the few Linuxes that don't cause Windows users permanent brain damage. Albeit. Linux Mint is bad because its all set up for you and there's no challenge in getting it exactly the way you want it with exactly the packages you want, but Linux Mint is a great way to ease the transition to Linux for beginners. Once you have broken free of Microsoft's mind games, you will discover true freedom and find it much easier to use MCP. I have laid down the path for you, but it is you who must traverse it. I wish you luck and low htop stats.

@RKvilt
Copy link

RKvilt commented Apr 28, 2020

@anoyco I know linux well im not a brain damaged windows user its just that all my files and my work is on the windows and i dont a bunch of it getting deleted i tried having two operating systems on my pc but i didint have enough space

@T0x1cBo1
Copy link

Error: Could not find or load main class Start
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

I did everything just like in the guide then this happened

@lolpota
Copy link

lolpota commented May 19, 2020

i keep getting this when i try to decompile. anyone know how to fix it?
> Decompiling '"java" -jar runtime\bin\fernflower.jar -din=1 -rbr=1 -dgs=1 -asc=1 -rsy=1 -iec=1 -jvn=1 -log=TRACE "-e=jars\libraries\net/java/jinput\jinput\2.0.5\jinput-2.0.5.jar" "-e=jars\libraries\com/ibm/icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar" "-e=jars\libraries\org/apache/httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar" "-e=jars\libraries\org/apache/logging/log4j\log4j-api\2.8.1\log4j-api-2.8.1.jar" "-e=jars\libraries\org/apache/commons\commons-lang3\3.5\commons-lang3-3.5.jar" "-e=jars\libraries\net/java/dev/jna\jna\4.4.0\jna-4.4.0.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl-platform\2.9.4-nightly-20150209\lwjgl-platform-2.9.4-nightly-20150209-natives-windows.jar" "-e=jars\libraries\com/paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar" "-e=jars\libraries\net/sf/jopt-simple\jopt-simple\5.0.3\jopt-simple-5.0.3.jar" "-e=jars\libraries\com/mojang\text2speech\1.10.3\text2speech-1.10.3.jar" "-e=jars\libraries\com/google/guava\guava\21.0\guava-21.0.jar" "-e=jars\libraries\oshi-project\oshi-core\1.1\oshi-core-1.1.jar" "-e=jars\libraries\org/apache/httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar" "-e=jars\libraries\org/apache/commons\commons-compress\1.8.1\commons-compress-1.8.1.jar" "-e=jars\libraries\com/mojang\text2speech\1.10.3\text2speech-1.10.3-natives-windows.jar" "-e=jars\libraries\it/unimi/dsi\fastutil\7.1.0\fastutil-7.1.0.jar" "-e=jars\libraries\net/java/dev/jna\platform\3.4.0\platform-3.4.0.jar" "-e=jars\libraries\com/paulscode\codecjorbis\20101023\codecjorbis-20101023.jar" "-e=jars\libraries\com/paulscode\soundsystem\20120107\soundsystem-20120107.jar" "-e=jars\libraries\com/paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl_util\2.9.4-nightly-20150209\lwjgl_util-2.9.4-nightly-20150209.jar" "-e=jars\libraries\commons-codec\commons-codec\1.10\commons-codec-1.10.jar" "-e=jars\libraries\net/java/jutils\jutils\1.0.0\jutils-1.0.0.jar" "-e=jars\libraries\com/mojang\patchy\1.1\patchy-1.1.jar" "-e=jars\libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl\2.9.4-nightly-20150209\lwjgl-2.9.4-nightly-20150209.jar" "-e=jars\libraries\commons-io\commons-io\2.5\commons-io-2.5.jar" "-e=jars\libraries\com/mojang\realms\1.10.17\realms-1.10.17.jar" "-e=jars\libraries\com/mojang\authlib\1.5.25\authlib-1.5.25.jar" "-e=jars\libraries\com/google/code/gson\gson\2.8.0\gson-2.8.0.jar" "-e=jars\libraries\net/java/jinput\jinput-platform\2.0.5\jinput-platform-2.0.5-natives-windows.jar" "-e=jars\libraries\com/paulscode\codecwav\20101023\codecwav-20101023.jar" "-e=jars\libraries\org/apache/logging/log4j\log4j-core\2.8.1\log4j-core-2.8.1.jar" "-e=jars\libraries\io/netty\netty-all\4.1.9.Final\netty-all-4.1.9.Final.jar" temp/minecraft_ff_in.jar temp\src\minecraft' failed : 1 Decompile failed Press any key to continue . . .

@GabbleGaming
Copy link

GabbleGaming commented May 20, 2020

while decompiling it says

Looking for minecraft main jar... Not found
Copying minecraft main jar...
Error while copying Minecraft : [Error 5] Access is denied: 'jars\versions\1.12.2\mcp-1.12.2-srg.zip'

please help

(EDIT) I fixed it but got this error

Copying library lwjgl-platform-natives-windows... Error copying library lwjgl-platform-natives-windows

@Mythbusters123
Copy link

Are there srg mappings for 1.15.2

@balaramsudip
Copy link

Are there srg mappings for 1.15.2

Yes

@balaramsudip
Copy link

balaramsudip commented Jun 21, 2020

WHEN the version.cfg file says 1.16-rc1, then it gives an error :
ERROR:root:FATAL ERROR
Traceback (most recent call last):
File "./runtime/decompile.py", line 61, in decompile
commands = Commands(conffile, verify=True, no_patch=no_patch, workdir=workdir, json=json)
File runtime/commands.py", line 178, in init
normalStart = self.readconf(workdir, json)
File runtime/commands.py", line 574, in readconf
jarslwjgl.append(os.path.join(self.dirjars,self.mcLibraries['lwjgl_util']['filename']))
KeyError: 'lwjgl_util'

However when the version.cfg is at 1.12, it freezes my terminal(Command prompt).

@HaredDev
Copy link

Many ofcourse want to make Mcp work with newer version of MC. But I would recommend McpConfig by the forge team. It will decomplie any MC version without forge, but requires extra tools to convert from srg mappings it will decomplie too, to MCP mappings.

@Nessiesson
Copy link

Correct RedCDev. These instructions are only really meant for Minecraft versions 1.12.2 and below since MCP and the way it is distributed have changed since 1.13.

@ThisTestUser
Copy link

If you really want to use MCP for 1.13+ (and you know how to run gradle commands), you can use this tutorial: https://github.com/ThisTestUser/MCPFixer
It should working for all versions above 1.13, however for 1.16 there are compile errors because the mappings are still on 1.15.1.

@VacCatGT
Copy link

huh its not finding my java how fix yes?

@HeyaGlitz
Copy link

HeyaGlitz commented Jul 22, 2020

I'm having a problem in which it cant find the temp files, it is because it tries to find a file named ?.java but Windows doesn't accept ? for filenames, so it names it , which looks like a dot and it isn't ASCII
`== MCP 9.18 (data: 9.18, client: 1.8.9, server: 1.8.9) ==
"scalac" is not found on the PATH. Scala files will not be recompiled

found ff, ff patches, srgs, name csvs, doc csvs, param csvs, astyle, astyle config, rg, ss

!! Modified jar detected. Unpredictable results !!
== Decompiling client using fernflower ==

Creating SRGs
Applying SpecialSource
Applying MCInjector
Creating renamed srg
Filtering classes
Decompiling
Unpacking jar
Copying sources
FATAL ERROR
Traceback (most recent call last):
File "runtime\decompile.py", line 136, in decompile
keep_lvt=keep_lvt, keep_generics=keep_generics, force_rg=force_rg)
File "C:\Users\bruno\Desktop\Mc Decompiler 1.8.9\runtime\mcp.py", line 54, in decompile_side
commands.copysrc(side)
File "C:\Users\bruno\Desktop\Mc Decompiler 1.8.9\runtime\commands.py", line 1706, in copysrc
self.copyandfixsrc(pathsrctmplk[side], pathsrclk[side])
File "C:\Users\bruno\Desktop\Mc Decompiler 1.8.9\runtime\commands.py", line 1727, in copyandfixsrc
normaliselines(src_file, dest_file)
File "C:\Users\bruno\Desktop\Mc Decompiler 1.8.9\runtime\pylibs\normlines.py", line 21, in normaliselines
with open(in_filename, 'rb') as in_file:
IOError: [Errno 22] invalid mode ('rb') or filename: 'temp\src\minecraft\net\minecraft\src\?.java'`

@Sicky2000
Copy link

I want to use mcp for 1.12.2, which mappings do I have to download?

@Nessiesson
Copy link

I want to use mcp for 1.12.2, which mappings do I have to download?

@Sicky2000: Follow the instructions exactly as given, i.e., use 1.12.2 srg mappings (http://files.minecraftforge.net/maven/de/oceanlabs/mcp/mcp/1.12.2/mcp-1.12.2-srg.zip) and use stable_39 MCP mappings (http://export.mcpbot.bspk.rs/mcp_stable/39-1.12/mcp_stable-39-1.12.zip).

@Roxiun
Copy link

Roxiun commented Nov 8, 2020

I would recommend just using MCP Reborn

@amysthat
Copy link

amysthat commented Dec 8, 2020

I have a problem. MCP decompiler has problems at copying ANYTHING to project. Each time, i have to manually download and copy them. Please help. (First JInput error, now icu4j-core-mojang)
And as I understand, there is a lot of libraries.
(I want to build for 1.12.2)

== MCP 9.40 (data: 9.40, client: 1.12.2, server: 1.12) ==
"scalac" is not found on the PATH.  Scala files will not be recompiled
# found ff, ff patches, srgs, name csvs, doc csvs, param csvs, astyle, astyle config, rg, ss
Looking in C:\Users\User\AppData\Roaming\.minecraft\versions for mc installs... OK
Copying assets... OK
Parsing JSON file... OK
Looking for minecraft main jar... OK
> Checking libraries...
        Copying library jinput... Error copying library jinput
Press any key to continue . . .

@amysthat
Copy link

amysthat commented Dec 8, 2020

For those who have same problem like me, here is the solution.
Condition: Admin and Current accounts are separate.

Start CMD with admin. Navigate to folder by cd FOLDER_PATH

Make sure that .minecraft is on admin account too. If not, just copy there.

Type decompile.
Wait and DONE!

@Godwhitelight
Copy link

hey i need some help. i am need help with recompiling it

ween i am useing eclipse export > jar
i am getting the error

Couldn't find .mcassetsroot

https://cdn.discordapp.com/attachments/782906681783746561/785510963997573120/unknown.png
full error

please help me

my discord like: https://discord.com/users/757244087685480508

@Lunarequest
Copy link

can some one help me I get a error because eclipse can't find jars/minecraft_server.1.12.jar I tried downloading the official server jar but it didn't work. Any suggestions on how to fix this?

@Smitthe
Copy link

Smitthe commented Jan 13, 2021

in my MCP, there are no libraries at all, i cannot find them, i am using 1.12.2.
i go into the jars folder and there are only 2 folders, saves and bin.

can anyone help me?

@DerWeiseILL
Copy link

Does someone know how i fix this? I use eclipse:

Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

@Gav06
Copy link

Gav06 commented Mar 16, 2021

that isnt a big issue @DerWeiseILL

@ech0devv
Copy link

ech0devv commented Jul 22, 2021

How do you link libraries?
Having the lwjgl64 issue

@pwn3r1
Copy link

pwn3r1 commented Jul 25, 2021

hey, when i decompile i get a lot of errors but the decompile is done, then i fix like 2 errors in eclipse and i get like 18 more that eclipse cant resolve some stuff to a variable, here are all of the 18 errors: https://pastebin.com/jSmsg3su
and when i try to run it from eclipse, this error happens: https://pastebin.com/C2PfMa5E
if you know how to fix, msg me on discord: pwn3r1#1243

@SolDev69
Copy link

SolDev69 commented Sep 9, 2021

You don't actually need the .csv mappings, the normal MCP ones will work fine

@TheKodeToad
Copy link

TheKodeToad commented Sep 25, 2021

If MCP exports is down, you can use the Maven repository for Forge.

Links:
1.8.9
1.12.2

Manual method:
Open this page. It has a list of versions. Look for the latest version corresponding to your Minecraft version, and download from https://maven.minecraftforge.net/de/oceanlabs/mcp/mcp_stable/<version>/mcp_stable-<version>.zip.

If you want even newer versions, this tool may help.

@hobrin
Copy link

hobrin commented Dec 29, 2021

@MIFO77
Copy link

MIFO77 commented Apr 5, 2022

Hey, just had a problem with the launch of the game, and in the jar/versions/1.12.2/1.12.2-natives there is no jar libraries that I can add in eclipse, so I have an error :

Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1122)
at org.lwjgl.Sys$1.run(Sys.java:72)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:87)
at org.lwjgl.Sys.(Sys.java:117)
at net.minecraft.client.Minecraft.getSystemTime(Minecraft.java:3300)
at net.minecraft.client.main.Main.main(Main.java:39)
at Start.main(Start.java:11)

@GradientGamer-XD
Copy link

GradientGamer-XD commented Nov 24, 2022

as of 11/24/22, mcpbot.bspk.rs is down so use web archive
Alternatively, refer to https://github.com/ModCoderPack/MCPMappingsArchive for mappings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment