MC Modding
Please register and join the community!


Join the forum, it's quick and easy

MC Modding
Please register and join the community!
MC Modding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Tools (pickaxe, axe, shovel, hoe, sword)

+9
lcass
jesshankin22
Themountaindewosse
filip151
ikke009
Strengthowns
proshitness
breakyorself
austin56101
13 posters

Page 1 of 2 1, 2  Next

Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Tools (pickaxe, axe, shovel, hoe, sword)

Post by austin56101 Sat Oct 22, 2011 5:15 am

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)
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
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 27
Location : Cali!

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by breakyorself Sat Oct 22, 2011 6:03 am

For the code i suggest using {code}/*code in here*/ {/code} but replace the { whith [.
breakyorself
breakyorself
Member

Posts : 60
Join date : 2011-10-19

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by proshitness Sat Oct 22, 2011 5:36 pm

dude, put it in a ["code] ["/code] without the : "
that make it a lot simpler.

proshitness
Member

Posts : 4
Join date : 2011-10-20

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by breakyorself Sat Oct 22, 2011 5:44 pm

proshitness wrote:dude, put it in a ["code] ["/code] without the : "
that make it a lot simpler.
I kinda posted that Neutral.
breakyorself
breakyorself
Member

Posts : 60
Join date : 2011-10-19

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by austin56101 Sat Oct 22, 2011 10:11 pm

sorry i just fixed it
austin56101
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 27
Location : Cali!

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by Strengthowns Sun Oct 23, 2011 5:09 am

Ahh. The newer posts are burying it! I'll fix the options now.
Strengthowns
Strengthowns
Admin

Posts : 79
Join date : 2011-06-14
Location : Right here!

http://www.mcmodding.4umer.com

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by ikke009 Tue Oct 25, 2011 8:27 pm

Why is the spade recipe "* *", "*", "*", and not 3 times "*" like the sword?
ikke009
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 29
Location : The netherlands

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by filip151 Tue Oct 25, 2011 8:30 pm

ikke009 wrote:Why is the spade recipe "* *", "*", "*", and not 3 times "*" like the sword?
Because the recipes collide, that's why! If it would be done your way, the game would crash!

filip151
Member

Posts : 11
Join date : 2011-10-21
Age : 25
Location : Norway, Oslo Poland, Swiecie

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by austin56101 Tue Oct 25, 2011 8:56 pm

Lol yea^
austin56101
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 27
Location : Cali!

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by Themountaindewosse Tue Oct 25, 2011 9:35 pm

how do you make like your own item into tools?

Themountaindewosse
Member

Posts : 3
Join date : 2011-10-24

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by austin56101 Tue Oct 25, 2011 9:40 pm

What type of item?
I think that he still is planning on making the adv items mod
austin56101
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 27
Location : Cali!

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by Themountaindewosse Tue Oct 25, 2011 9:52 pm

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

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by austin56101 Tue Oct 25, 2011 10:07 pm

mod_yourfile.yourignot
In your recipie
austin56101
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 27
Location : Cali!

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by Themountaindewosse Tue Oct 25, 2011 10:17 pm

thanks What a Face

Themountaindewosse
Member

Posts : 3
Join date : 2011-10-24

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by austin56101 Wed Oct 26, 2011 2:02 am

np np just doing my job Smile
austin56101
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 27
Location : Cali!

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by jesshankin22 Thu Oct 27, 2011 8:31 pm

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

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by ikke009 Thu Oct 27, 2011 8:49 pm

complete wrong topic, but you have to recompile first before running your client..
ikke009
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 29
Location : The netherlands

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by lcass Thu Oct 27, 2011 9:59 pm

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

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

https://www.youtube.com/user/thealcasgroup

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by austin56101 Thu Oct 27, 2011 10:10 pm

Please delete your post
Repost in help section
austin56101
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 27
Location : Cali!

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by lcass Thu Oct 27, 2011 10:19 pm

soz it does fit in with the post though its items

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

https://www.youtube.com/user/thealcasgroup

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by austin56101 Fri Oct 28, 2011 1:04 am

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 belongs in the help section
austin56101
austin56101
Moderator
Moderator

Posts : 85
Join date : 2011-10-22
Age : 27
Location : Cali!

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by ikke009 Fri Oct 28, 2011 11:21 am

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
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 29
Location : The netherlands

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by mastereric Fri Oct 28, 2011 2:46 pm

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???
I had this error. Before decompiling you should have installed Modloader on the jar.

This worked perfectly! Thank you!
mastereric
mastereric
Member

Posts : 30
Join date : 2011-10-26

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by MrCreeper07 Sat Oct 29, 2011 4:56 am

hey so theres only one class for all the tools?

EDIT: also how do you just add one tool like a sword?
MrCreeper07
MrCreeper07
Member

Posts : 18
Join date : 2011-10-23

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by jesshankin22 Sat Oct 29, 2011 4:59 am

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

Back to top Go down

Tools (pickaxe, axe, shovel, hoe, sword) Empty Re: Tools (pickaxe, axe, shovel, hoe, sword)

Post by Sponsored content


Sponsored content


Back to top Go down

Page 1 of 2 1, 2  Next

Back to top

- Similar topics

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