ZidMC
Would you like to react to this message? Create an account in a few clicks or log in to continue.

PLEASE HELP unsolvable error :I

3 posters

Go down

PLEASE HELP unsolvable error :I Empty PLEASE HELP unsolvable error :I

Post by Dumbbumb1 Fri May 06, 2011 8:57 pm

Please help ive been trying to fix this code for 2 days now

errors:

PLEASE HELP unsolvable error :I Error12

Code(s)

Mod_MBATTLEAXE.java:

package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode


public class mod_MBATTLEAXE extends BaseMo
{
public String Version()
{
return "1.5_01";
}


public static final ItembattleaxeWood = new Itembattleaxewood(4000);


}


Itembattleaxewood.java:

package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode


public class Itembattleaxewood extends Item

public Itembattleaxewood(int i)
{
super(i);
maxStackSize = 1;
maxDamage = 100;
field_22047_d = 10;
}

public void hitEntity(ItemStack itemstack, EntityLiving entityliving)
{
itemstack.damageItem(1);
}

public void hitBlock(ItemStack itemstack, int i, int j, int k, int l)
{
itemstack.damageItem(2);
}

public int getDamageVsEntity(Entity entity)
{
return field_22047_d;
}

public boolean isFull3D()
{
return true;
}

private int field_22047_d;
}


Again, anybody who knows the problem please help Very Happy?

Dumbbumb1
Crafter

Posts : 13
Join date : 2011-05-06

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by lKinx Fri May 06, 2011 9:31 pm

For one, it should say "mod_Battleaxewood extends BaseMod" *Note* You can put anything after the mod_, but just make sure it matches what is in the code.

Also, it should say "public static final Itembattleaxewood = new Itembattleaxewood(4000);" at the end of the first code. I'm not sure if it makes a difference, but it won't hurt.

~lKinx

lKinx
Crafter

Posts : 18
Join date : 2011-04-30

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Dumbbumb1 Fri May 06, 2011 10:54 pm

Thanks for the input, but just to clarify, The battleaxewood was the item class not the Mod_* class. The Mod_ class was Mod_MBATTLEAXE.java

I managed to fix the obvious coding error that i overlooked many times with missing the first { that had to be in itembattleaxewood.java. But i still have yet to figure out the (identifier) Expected problem. Any help?

Dumbbumb1
Crafter

Posts : 13
Join date : 2011-05-06

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Meglazero Fri May 06, 2011 11:08 pm

Have you tried to recompile it since missing the first curly brace? Normally the multiple errors you get when recompiling are just because you missed something or added something extra by accident, and when you fix that and recompile it'll either give you more or less errors and then you work off those new errors.

Meglazero
Iron Miner

Posts : 51
Join date : 2011-04-22

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Dumbbumb1 Fri May 06, 2011 11:24 pm

Meglazero wrote:Have you tried to recompile it since missing the first curly brace? Normally the multiple errors you get when recompiling are just because you missed something or added something extra by accident, and when you fix that and recompile it'll either give you more or less errors and then you work off those new errors.

Yeah, after adding the curly brace i did try to recompile and was still stuck with the (identifier) expected error

Dumbbumb1
Crafter

Posts : 13
Join date : 2011-05-06

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Meglazero Fri May 06, 2011 11:32 pm

Alright, try this in your mod_Mthingy

Code:

public static final Item ItembattleaxeWood = new Item(4000).setItemName("Itembattleaxewood");

Meglazero
Iron Miner

Posts : 51
Join date : 2011-04-22

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Dumbbumb1 Fri May 06, 2011 11:35 pm

Meglazero wrote:Alright, try this in your mod_Mthingy

Code:

public static final Item ItembattleaxeWood = new Item(4000).setItemName("Itembattleaxewood");

Thanks, now that has brought up a whole set of new errors but fixed that old one Very Happy. so i will get back to you if i need more help.

Dumbbumb1
Crafter

Posts : 13
Join date : 2011-05-06

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Meglazero Fri May 06, 2011 11:40 pm

Np man, glad I could help

Meglazero
Iron Miner

Posts : 51
Join date : 2011-04-22

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Dumbbumb1 Fri May 06, 2011 11:43 pm

PLEASE HELP unsolvable error :I Error13

Howbout now?

heres the new code

Mod_MBATTLEAXE.java

package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode


public class Mod_MBATTLEAXE extends BaseMod


{
public String Version()
{
return "1.5_01";
}

public static final Item ItembattleaxeWood = new Item(4000).setItemName("Itembattleaxewood");


}


Itembattleaxewood.java

package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode


public class Itembattleaxewood extends Item
{

public Itembattleaxewood(int i)
{
super(i);
maxStackSize = 1;
maxDamage = 100;
field_22047_d = 10;
}

public void hitEntity(ItemStack itemstack, EntityLiving entityliving)
{
itemstack.damageItem(1);
}

public void hitBlock(ItemStack itemstack, int i, int j, int k, int l)
{
itemstack.damageItem(2);
}

public int getDamageVsEntity(Entity entity)
{
return field_22047_d;
}

public boolean isFull3D()
{
return true;
}

private int field_22047_d;
}


New ideas?
Sorry for being needy but im kind of new to coding
PS: its not like i dont know anything, i did fix about 5 errors before uploading this without anyones help Very Happy


Last edited by Dumbbumb1 on Fri May 06, 2011 11:48 pm; edited 1 time in total (Reason for editing : Had to add the PS)

Dumbbumb1
Crafter

Posts : 13
Join date : 2011-05-06

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Meglazero Fri May 06, 2011 11:50 pm

How/where did you get the code you put for your Itembattleswordwood item? My suggestion... (this is how I'm making my weapons atm when I feel like working on my own mod) is I copied ItemSword.java over, and I made my own toolmaterial set... just copy and pasted EnumToolMaterial so I can make changes to it for whatever I need without changing any of the base game files (rename it too, like I named mine EnhanceToolMaterial... still works as long as you tell your new file to call on that instead of Enum) and go from there. I'm relatively new at coding too, so I don't know that much about weapons atm... so idk how much what I can tell you will be able to help but it might make a small difference.

Meglazero
Iron Miner

Posts : 51
Join date : 2011-04-22

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Dumbbumb1 Fri May 06, 2011 11:53 pm

Meglazero wrote:How/where did you get the code you put for your Itembattleswordwood item? My suggestion... (this is how I'm making my weapons atm when I feel like working on my own mod) is I copied ItemSword.java over, and I made my own toolmaterial set... just copy and pasted EnumToolMaterial so I can make changes to it for whatever I need without changing any of the base game files (rename it too, like I named mine EnhanceToolMaterial... still works as long as you tell your new file to call on that instead of Enum) and go from there. I'm relatively new at coding too, so I don't know that much about weapons atm... so idk how much what I can tell you will be able to help but it might make a small difference.

Thx man, thats a good idea so i will do that, but anyone who still knows the solution to this please do tell, me and my friends have been having problems with all these stupid errors lately :I

Wheres the damage for the materials in enumtoolmaterial?

Dumbbumb1
Crafter

Posts : 13
Join date : 2011-05-06

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Dumbbumb1 Sat May 07, 2011 12:12 am

I used your advice, and compiled the mod without problems but the item wont show up ingame, any idea why?

Dumbbumb1
Crafter

Posts : 13
Join date : 2011-05-06

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Meglazero Sat May 07, 2011 1:02 am

You using toomanyitems to see it or just trying to craft it? And did you add an override for the texture?

Meglazero
Iron Miner

Posts : 51
Join date : 2011-04-22

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Meglazero Sat May 07, 2011 1:13 am

Code:

    WOOD("WOOD", 0, 0, 59, 2.0F, 0),
    STONE("STONE", 1, 1, 131, 4F, 1),
    IRON("IRON", 2, 2, 250, 6F, 2),
    EMERALD("EMERALD", 3, 3, 1561, 8F, 3),
    GOLD("GOLD", 4, 0, 32, 12F, 0);

On this part... in order
1) basically an ID number for the pieces... so if you made your own it'd be 5 next
2) harvest level... I believe that's how high you can harvest... like, how you need stone to mine iron, and iron for diamond etc.
3) maxUses, i.e. how many hits before it breaks
4) efficiency on proper material.. I think that means how fast it breaks a material it's supposed to be used on
5) damage vs entity which is the main one for weapons I believe since in your weapons it calls on"weaponDamage = 4 + enumtoolmaterial.getDamageVsEntity() * 2;"

and the reason it's probably not showing up in game is because you haven't given it any of the other things you need for it to show up really... try adding this:

Code:

public mod_Enhance()
{

ItembattleaxeWood.iconIndex = ModLoader.addOverride("/gui/items.png", "/battleaxe/itembattleaxewood.png");
ModLoader.AddName(ItembattleaxeWood, "Wooden Battle Axe");
ModLoader.AddRecipe(new ItemStack(ItembattleaxeWood, 1), new Object[] {
         "X", "#", Character.valueOf('X'),  Item.swordWood
        });
}

Just add all that somewhere in your public class mod_Mbattlethingy declaration somewhere, and then make up a sprite for your battle axe somehow, doesn't have to be anything fancy for testing... make sure that gets put into your .jar inside of a folder named "battleaxe" or whatever you feel like changing it to, then go back in and see if it exists this time. The crafting recipe isn't necessary, but adding the override and giving it a name pretty much are. The item might actually exist but if you can't see the name or an image for it, it may as well not be there :p

Meglazero
Iron Miner

Posts : 51
Join date : 2011-04-22

Back to top Go down

PLEASE HELP unsolvable error :I Empty Re: PLEASE HELP unsolvable error :I

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum