Tools (pickaxe, axe, shovel, hoe, sword)
+9
lcass
jesshankin22
Themountaindewosse
filip151
ikke009
Strengthowns
proshitness
breakyorself
austin56101
13 posters
Page 1 of 2
Page 1 of 2 • 1, 2
Tools (pickaxe, axe, shovel, hoe, sword)
NOT MADE BY ME, MADE BY HENRY
Here is the code I wrote in the tutorial. You can copy paste it if you like. Just make sure you paste it into a new file called mod_Tools.java. Or, if you want to change the name, make sure you replace wherever it says “mod_Tools” to the name of your mod. Also, don’t forget to name your textures accordingly.
//THIS CODE GOES INTO YOUR mod_Tools.java FILE! (or whatever you named your mod_*YourModNameHere*.java file)
Here is the code I wrote in the tutorial. You can copy paste it if you like. Just make sure you paste it into a new file called mod_Tools.java. Or, if you want to change the name, make sure you replace wherever it says “mod_Tools” to the name of your mod. Also, don’t forget to name your textures accordingly.
//THIS CODE GOES INTO YOUR mod_Tools.java FILE! (or whatever you named your mod_*YourModNameHere*.java file)
- Code:
package net.minecraft.src;
import java.util.Random;
public class mod_Tools extends BaseMod
{
//Here we declare all of our new tools.
public static final Item Pick = new ItemPickaxe(2001, EnumToolMaterial.EMERALD).setItemName("asdf");
public static final Item Spade = new ItemSpade(2002, EnumToolMaterial.EMERALD).setItemName("sdfa");
public static final Item Axe = new ItemAxe(2003, EnumToolMaterial.EMERALD).setItemName("dfas");
public static final Item Hoe = new ItemHoe(2004, EnumToolMaterial.EMERALD).setItemName("fasd");
public static final Item Sword = new ItemSword(2005, EnumToolMaterial.EMERALD).setItemName("adsf");
public mod_Tools()
{
//Here we override all the textures, and add our own.
//Make sure the name of your texture is the same what you write here
Pick.iconIndex = ModLoader.addOverride("/gui/items.png", "/Pick.png");
Spade.iconIndex = ModLoader.addOverride("/gui/items.png", "/Spade.png");
Axe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Axe.png");
Hoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Hoe.png");
Sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/Sword.png");
//Here we add the in game names to all the tools.
ModLoader.AddName(Pick, "Pickaxe");
ModLoader.AddName(Spade, "Shovel");
ModLoader.AddName(Axe, "Axe");
ModLoader.AddName(Hoe, "Hoe");
ModLoader.AddName(Sword, "Sword");
//Here are all the recipes for each tool (all of them are made out of dirt)
ModLoader.AddRecipe(new ItemStack(Pick, 1), new Object[] {
"***", " * ", " * ", Character.valueOf('*'), Block.dirt
});
ModLoader.AddRecipe(new ItemStack(Axe, 1), new Object[] {
"** ", "** ", " * ", Character.valueOf('*'), Block.dirt
});
ModLoader.AddRecipe(new ItemStack(Spade, 1), new Object[] {
"* *", " * ", " * ", Character.valueOf('*'), Block.dirt
});
ModLoader.AddRecipe(new ItemStack(Hoe, 1), new Object[] {
"** ", " * ", " * ", Character.valueOf('*'), Block.dirt
});
ModLoader.AddRecipe(new ItemStack(Sword, 1), new Object[] {
" * ", " * ", " * ", Character.valueOf('*'), Block.dirt
});
}
public String Version()
{
return "3.14159265";
}
}
Last edited by austin56101 on Sat Oct 22, 2011 8:00 pm; edited 1 time in total (Reason for editing : /code)
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Re: Tools (pickaxe, axe, shovel, hoe, sword)
For the code i suggest using {code}/*code in here*/ {/code} but replace the { whith [.
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: Tools (pickaxe, axe, shovel, hoe, sword)
dude, put it in a ["code] ["/code] without the : "
that make it a lot simpler.
that make it a lot simpler.
proshitness- Member
- Posts : 4
Join date : 2011-10-20
Re: Tools (pickaxe, axe, shovel, hoe, sword)
I kinda posted that .proshitness wrote:dude, put it in a ["code] ["/code] without the : "
that make it a lot simpler.
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: Tools (pickaxe, axe, shovel, hoe, sword)
sorry i just fixed it
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Re: Tools (pickaxe, axe, shovel, hoe, sword)
Ahh. The newer posts are burying it! I'll fix the options now.
Re: Tools (pickaxe, axe, shovel, hoe, sword)
Why is the spade recipe "* *", "*", "*", and not 3 times "*" like the sword?
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: Tools (pickaxe, axe, shovel, hoe, sword)
Because the recipes collide, that's why! If it would be done your way, the game would crash!ikke009 wrote:Why is the spade recipe "* *", "*", "*", and not 3 times "*" like the sword?
filip151- Member
- Posts : 11
Join date : 2011-10-21
Age : 26
Location : Norway, Oslo Poland, Swiecie
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Re: Tools (pickaxe, axe, shovel, hoe, sword)
how do you make like your own item into tools?
Themountaindewosse- Member
- Posts : 3
Join date : 2011-10-24
Re: Tools (pickaxe, axe, shovel, hoe, sword)
What type of item?
I think that he still is planning on making the adv items mod
I think that he still is planning on making the adv items mod
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Re: Tools (pickaxe, axe, shovel, hoe, sword)
i mean if i have like a ingot that i made how do i make that into tools?
Themountaindewosse- Member
- Posts : 3
Join date : 2011-10-24
Re: Tools (pickaxe, axe, shovel, hoe, sword)
mod_yourfile.yourignot
In your recipie
In your recipie
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Themountaindewosse- Member
- Posts : 3
Join date : 2011-10-24
Re: Tools (pickaxe, axe, shovel, hoe, sword)
np np just doing my job
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Re: Tools (pickaxe, axe, shovel, hoe, sword)
ok so what's going on.... I installed modloader and decompiled it correctly, but when i run the mod it says " cannot find symbol ModLoader" and help???
^
^
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: Tools (pickaxe, axe, shovel, hoe, sword)
complete wrong topic, but you have to recompile first before running your client..
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: Tools (pickaxe, axe, shovel, hoe, sword)
do you have any idea on how to add something eg a picksword I may look into it maybe see how they did it in the uranium mod
Re: Tools (pickaxe, axe, shovel, hoe, sword)
Please delete your post
Repost in help section
Repost in help section
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Re: Tools (pickaxe, axe, shovel, hoe, sword)
This belongs in the help sectionjesshankin22 wrote:ok so what's going on.... I installed modloader and decompiled it correctly, but when i run the mod it says " cannot find symbol ModLoader" and help???
^
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Re: Tools (pickaxe, axe, shovel, hoe, sword)
you, as a moderator, should be able to do that yourself, since jess isnt reacting. but we are getting a bit off topic.. theundecidedt made a video yesterday about this, its very good i am going to make some tools this afternoon with the help of this tutorial and that video..
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: Tools (pickaxe, axe, shovel, hoe, sword)
I had this error. Before decompiling you should have installed Modloader on the jar.jesshankin22 wrote:ok so what's going on.... I installed modloader and decompiled it correctly, but when i run the mod it says " cannot find symbol ModLoader" and help???
This worked perfectly! Thank you!
mastereric- Member
- Posts : 30
Join date : 2011-10-26
Re: Tools (pickaxe, axe, shovel, hoe, sword)
hey so theres only one class for all the tools?
EDIT: also how do you just add one tool like a sword?
EDIT: also how do you just add one tool like a sword?
MrCreeper07- Member
- Posts : 18
Join date : 2011-10-23
Re: Tools (pickaxe, axe, shovel, hoe, sword)
you would just delete all the other tools' coding... and btw austin... I'm not positive on how to delete posts.... sorry about that =/
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Page 1 of 2 • 1, 2
Similar topics
» [Unanswered] sword code
» [1.1] tools set
» [Request} Special Tools
» [unanswered] making new materials and tools
» [1.1] tools set
» [Request} Special Tools
» [unanswered] making new materials and tools
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum