creating a new type of tool
2 posters
Page 1 of 1
creating a new type of tool
So I have again seen some request's lots from ikke so here it is how to make a new type of tool to go with your mod remember to do the graphics. now when I have things that say tooltype and I put them in caps that means you delete them aswell or you will get lots of null pointer exceptions its to seperate out the TileEntitys in some of my tutorials remember to still change the name here bit.....
first you will need two class the mod_namehere.class and you will need TOOLTYPE.class.
so lets start out with the TOOLTYPE.class now its pretty much the same here if you dont know how to change the enumtoolmatirial go look at the tutorial done by austin56101 (yer I know I have bad spelling)
lets get started I will explain more at the bottom.
in the static section the bits where it says
so now onto the mod_file this will be one I use from my code same one henry the coder did but not a full set.
you should know exactly what to do from this point on I will just post up the code.
first you will need two class the mod_namehere.class and you will need TOOLTYPE.class.
so lets start out with the TOOLTYPE.class now its pretty much the same here if you dont know how to change the enumtoolmatirial go look at the tutorial done by austin56101 (yer I know I have bad spelling)
lets get started I will explain more at the bottom.
- Code:
// 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
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// ItemTool, Block, EnumToolMaterial
public class TOOLTYPEnamehere extends ItemTool
{
public TOOLTYPEnamehere(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, 1, enumtoolmaterial, blocksEffectiveAgainst);
}
public boolean canHarvestBlock(Block block)
{
if(block == mod_emerald.emerald)
{
return true;
}
return block == Block.blockSnow;
}
private static Block blocksEffectiveAgainst[];
static
{
blocksEffectiveAgainst = (new Block[] {
Block.stone, Block.cobblestone, Block.wood, Block.oreRedstone, Block.snow, Block.blockDiamond, Block.blockClay, Block.tilledField
});
}
}
in the static section the bits where it says
- Code:
blocksEffectiveAgainst = (new Block[] {
Block.stone, Block.cobblestone, Block.wood, Block.oreRedstone, Block.snow, Block.blockDiamond, Block.blockClay, Block.tilledField
so now onto the mod_file this will be one I use from my code same one henry the coder did but not a full set.
you should know exactly what to do from this point on I will just post up the code.
- Code:
package net.minecraft.src;
import java.util.Random;
public class mod_namehere extends BaseMod
{
public static final Item TOOLTYPEnamehere = new TOOLTYPEnamehere(20211,EnumToolMaterial.ruby). setItemName("namehereitem");
public mod_namehere()
{
TOOLTYPEnamehere.iconIndex = ModLoader.addOverride("/gui/items.png", "/namehere/namehere.png");
ModLoader.AddName(TOOLTYPEnamehere,"namehere");
ModLoader.AddRecipe(new ItemStack(TOOLTYPEnamehere, 1), new Object[] {
"EEE","EPE"," P ", Character.valueOf('P'), Item.stick , Character.valueOf('E') , mod_plutore.plutore
});
}
public String Version()
{
return "1.8.1";
}
}
Re: creating a new type of tool
This still doesnt explain what i requested, if destroy a block called emeraldblock with my new tooltype chisel, i get an item called emeraldcrystal. if i destroy emeraldblock with a pickaxe, i get an emeraldblock.
if i destroy emeraldblock with anything else, i get nothing.
if i destroy emeraldblock with anything else, i get nothing.
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: creating a new type of tool
ahhh I have no ffinh Idea unless youwere to do onblockrightclick for the chisel then set it as the return it wouldn't make a diff you can keep it the same for pick
Similar topics
» [CREATING MODS] Block Manipulation
» [UnAnswered]Tool Error.
» [1.2.3]making new tool types (example paxel)
» [1.8.1 Mod Making] Creating a new torch!
» Creating your first java program!
» [UnAnswered]Tool Error.
» [1.2.3]making new tool types (example paxel)
» [1.8.1 Mod Making] Creating a new torch!
» Creating your first java program!
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum