Jump to content

Modloader.setPrivateValue failing after reobfuscation

Recommended Posts



I've been trying to set the private values in EnumCreatureType using ModLoader.setPrivateValue.  This works fine in the eclipse environment but when i come to reobfuscate it doesn't update the name of the field that i'm trying to set and so it will die with a fieldNotFound exception.


Is this a bug or am i doing something not supported?



Link to comment
Share on other sites

By using MCPBot on espernet.


<LexManos> gcf Minecraft.thePlayer


-MCPBot-  Side        : client

-MCPBot-  Name        : Minecraft.thePlayer

-MCPBot-  Notch      : Minecraft.h

-MCPBot-  Searge      : field_6322_g

-MCPBot-  Type/Notch  : LEntityPlayerSP; | Lvq;

-MCPBot-  Description : The player who's actually in control of this game.

Or, looking at the maping files inside the conf folder, those are fairly self explanatory.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Alright, so i found that maxNumberOfCreature was reobfuscated to field_21108_e but when i switched the call over to that field it still came up saying that the field could not be found:

try {
		ModLoader.setPrivateValue(EnumCreatureType.class, EnumCreatureType.monster, "field_21108_e", 80);
		ModLoader.setPrivateValue(EnumCreatureType.class, EnumCreatureType.creature, "field_21108_e", 80);
		ModLoader.setPrivateValue(EnumCreatureType.class, EnumCreatureType.waterCreature, "field_21108_e", 100);
	} catch (Throwable e) {


[sEVERE] Unexpected exception

java.lang.RuntimeException: java.lang.NoSuchFieldException: field_21108_e

at cpw.mods.fml.common.ReflectionHelper.setPrivateValue(ReflectionHelper.java:93)

at ModLoader.setPrivateValue(ModLoader.java:731)

at pixelmon.PixelmonSpawner.init(PixelmonSpawner.java:17)

at mod_Pixelmon.addSpawns(mod_Pixelmon.java:271)

at mod_Pixelmon.load(mod_Pixelmon.java:214)

at cpw.mods.fml.common.modloader.ModLoaderModContainer.init(ModLoaderModContainer.java:351)

at cpw.mods.fml.common.Loader.modInit(Loader.java:263)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:604)

at cpw.mods.fml.server.FMLServerHandler.onLoadComplete(FMLServerHandler.java:147)

at net.minecraft.server.MinecraftServer.s(MinecraftServer.java:204)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:412)

at dn.run(SourceFile:492)

Caused by: java.lang.NoSuchFieldException: field_21108_e

at java.lang.Class.getDeclaredField(Unknown Source)

at cpw.mods


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

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