Posted April 4, 201312 yr EDIT: This seems to be a problem that only affects the Eclipse IDE. I have changed my *temporary* fix here to reflect the one being committed to the Forge core. I was having a horrible time getting EnumHelper.addToolMaterial() to work for me, I must have looked at dozens of threads on various sites before I decided to see if the code itself was broken. Skip to the header "The Fix" if you're not ready to hear me banter. The Process (Seemed like a fine name to me) The amount of devil-worship that goes on inside this class is unspeakable. But I digress. For those of you having issues getting around the following error output: 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] Could not find $VALUES field for enum: net.minecraft.item.EnumToolMaterial 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] Runtime Deobf: false 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] Fields: 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] WOOD: net.minecraft.item.EnumToolMaterial 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] STONE: net.minecraft.item.EnumToolMaterial 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] IRON: net.minecraft.item.EnumToolMaterial 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] EMERALD: net.minecraft.item.EnumToolMaterial 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] GOLD: net.minecraft.item.EnumToolMaterial 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] harvestLevel: int 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] maxUses: int 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] efficiencyOnProperMaterial: float 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] damageVsEntity: int 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] enchantability: int 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] customCraftingMaterial: net.minecraft.item.Item 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] $SWITCH_TABLE$net$minecraft$item$EnumToolMaterial: [i 2013-04-03 23:13:03 [sEVERE] [ForgeModLoader] ENUM$VALUES: [Lnet.minecraft.item.EnumToolMaterial; I get this error for innocuously doing nothing but defining my material: package mods.lantz; import net.minecraft.item.EnumToolMaterial; import net.minecraftforge.common.EnumHelper; import cpw.mods.fml.common.*; import cpw.mods.fml.common.Mod.*; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.*; @Mod(modid = "Lantz", name = "Lantz' Mod", version = "0.0.0") @NetworkMod(clientSideRequired=true, serverSideRequired=false) public class Lantz { // The instance of your mod that Forge uses. @Instance("Lantz") public static Lantz instance; public static final EnumToolMaterial ADMANTIUM = EnumHelper.addToolMaterial("ADMANTIUM", 2, 2000, 8.0F, 2, 18); // Says where the client and server 'proxy' code is loaded. @SidedProxy(clientSide="mods.lantz.client.ClientProxy", serverSide="mods.lantz.CommonProxy") public static CommonProxy proxy; @PreInit public void preInit(FMLPreInitializationEvent event) { // Stub Method } @Init public void load(FMLInitializationEvent event) { proxy.registerRenderers(); } @PostInit public void postInit(FMLPostInitializationEvent event) { // Stub Method } } I noticed that the last line in the error output mentioned a field named "ENUM$VALUES" The Fix So, I fixed the error by making the following change to EnumHelper: // if (field.getName().equals("$VALUES")) // change to: if (field.getName().equals("$VALUES") || field.getName().equals("ENUM$VALUES")) And Voila, fixed. Thoughts/Comments/Pitchforks? Yes, my ideas can be naive. But I'm hoping that speaking my mind will inspire those who know what they are doing!
April 4, 201312 yr PLease tell me this is a bug in forge... This is the creator of the Rareores mod! Be sure to check it out at
April 4, 201312 yr https://github.com/MinecraftForge/MinecraftForge/issues/502#issuecomment-15915024 I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
April 5, 201312 yr Author I'm glad to see that the fix had been committed. Excuse my erratic knowledge of the bug base, I had trouble finding the bug previously. When will this change be available in a stable release? Yes, my ideas can be naive. But I'm hoping that speaking my mind will inspire those who know what they are doing!
April 5, 201312 yr This change does not effect runtime at all this is purely a development time deal. As it's the eclipse compiler that doesn't compile it to standard names. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
April 5, 201312 yr Author Yes, I gathered that. Thanks Lex! Yes, my ideas can be naive. But I'm hoping that speaking my mind will inspire those who know what they are doing!
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.