Jump to content

[1.7.10] Class Appears Different after Exporting Mod


Recommended Posts

Previously, I posted about adding spawn eggs for vanilla mobs that do not already have them. The solution I ended up finding was to add them manually. For instance, here is the code I used to add an EnderDragon egg:


cpw.mods.fml.common.registry.EntityList.entityEggs.put(Integer.valueOf(63), new EntityList.EntityEggInfo(63, 0x000000, 0x660066))


This works excellently when I launch the project from eclipse, but after copying out the mod files, compressing them, and placing them into my mods folder, I get an error:


java.lang.NoSuchFieldError: entityEggs


Why would the entityEggs ArrayList exist only when launching the project from eclipse?

Link to comment
Share on other sites



the vanilla minecraft files are obfuscated (all the class and field names are meaningless).  In your development environment, they are all deobfuscated to something meaningful.


That means that you need to reobfuscate your code when putting into your mods folder, i.e. you can't just copy the files.


Use the gradle build  command instead, the properly packaged jar with reobfuscated names will be in build/libs



Link to comment
Share on other sites

This topic is now closed to further replies.

  • Create New...

Important Information

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