1

Help with my mod (SOLVED)

Master__Chief777 10/11/12 11:48 pm
367
10/12/2012 6:47 pm
im making a mod for thor and the recompiler gives me this and i dont see why: (its probably ADD but please help me anyways)
this error is fixed working on the new ones

src\minecraft\net\minecraft\src\ItemMjolnir.java:8: error: reached end of file while parsing

}

^

1 error

heres the code:
package net.minecraft.src;
import java.util.Random;

public class mod_thor extends BaseMod
{
public static final Item m_Mjolnir = new Mjolnir(2000)
.setItemName("m_Mjolnir");

public String getVersion()
{
return "thor 1.0.0";
}
public void load() { }

public mod_thor()
{
ModLoader.addName(m_Mjolnir, "Mjolnir");

m_Mjolnir.iconIndex = ModLoader.addOverride("/gui/items.png", "/thor_mod/GFX/Mjolnir");

ModLoader.addRecipe(new ItemStack(m_Mjolnir, 1), new Object []{"###" , "###" , " B " ,
Character.valueOf('#'), Item.ingotIron
, Character.valueOf('B'), Item.stick });

}
}


and heres the ItemMjolnir that i forgot
package net.minecraft.src;

public class Mjlonir extends Item
{public Mjlonir(int i)
{
super(i);
maxStackSize = 1;
}
Posted by
Master__Chief777
Level 19 : Journeyman Taco
3

  Have something to say?

JoinSign in

16

Master__Chief777
10/12/2012 6:47 pm
Level 19 : Journeyman Taco
but everything seem to be working
1
Master__Chief777
10/12/2012 6:47 pm
Level 19 : Journeyman Taco
im in notepad++
eclipse isnt working today for some reason
1
Sager2210
10/12/2012 6:21 pm
Level 19 : Journeyman Miner
are yo using eclipsE? it tells yo the error and most of the time how you can fix it!
1
Master__Chief777
10/12/2012 6:19 pm
Level 19 : Journeyman Taco
that fixed the problem
compile...
got this
src\minecraft\net\minecraft\src\ItemMjolnir.java:4: error: invalid method declaration; return type required

{public Mjlonir(int i)

^

1 error
1
Sager2210
10/12/2012 6:18 pm
Level 19 : Journeyman Miner
package net.minecraft.src;

public class ItemMjlonir extends Item
{public ItemMjlonir(int i)
{
super(i);
maxStackSize = 1;
}
}

Heres the code should be fixed all you were missing is a "squiglly bracket*
1
Master__Chief777
10/12/2012 6:14 pm
Level 19 : Journeyman Taco
ok that would make sense thats sorry about that last post
1
Master__Chief777
10/12/2012 6:14 pm
Level 19 : Journeyman Taco
i did that but the error is in the item file
1
tung362
10/12/2012 5:53 pm
Level 55 : Grandmaster Modder
try moving " public void load() { }" down near the bottom of the code and move

" public mod_thor()
{
ModLoader.addName(m_Mjolnir, "Mjolnir");

m_Mjolnir.iconIndex = ModLoader.addOverride("/gui/items.png", "/thor_mod/GFX/Mjolnir");

ModLoader.addRecipe(new ItemStack(m_Mjolnir, 1), new Object []{"###" , "###" , " B " ,
Character.valueOf('#'), Item.ingotIron
, Character.valueOf('B'), Item.stick });

}"

to near the top where your public final static code is.


in your item code:

you forgot "}" at the end

heres what it should look like

package net.minecraft.src;

public class Mjlonir extends Item
{public Mjlonir(int i)
{
super(i);
maxStackSize = 1;
}
}
1
Master__Chief777
10/12/2012 5:50 pm
Level 19 : Journeyman Taco
would you tell me then kind sir?
1
Darknight781
10/12/2012 5:45 pm
Level 19 : Journeyman Network
I Know Why
1
Master__Chief777
10/12/2012 5:42 pm
Level 19 : Journeyman Taco
updated the code you see here still problematic
1
Master__Chief777
10/12/2012 5:31 pm
Level 19 : Journeyman Taco
deleted all the unecessary stuff
1
Master__Chief777
10/12/2012 5:10 pm
Level 19 : Journeyman Taco
went ahead an rewrote the whole thing still giving me that
1
Master__Chief777
10/12/2012 12:08 am
Level 19 : Journeyman Taco
he he it seems i posted this in the wrong place he he
please still help me
1
Master__Chief777
10/12/2012 12:02 am
Level 19 : Journeyman Taco
BUMP BUMP *cough* it would be nice if someone took a minute to help *cough* (i have a cold) BUMP BUMP
1
Master__Chief777
10/11/2012 11:55 pm
Level 19 : Journeyman Taco
fixed spelling errors no difference
1

Welcome