[unanswered] making new materials and tools
3 posters
MC Modding :: Modding :: Singleplayer Modding :: Requests
Page 1 of 2
Page 1 of 2 • 1, 2
[unanswered] making new materials and tools
So here is what i am trying to do for my mod:
I made a new block, emerald block, and i want to create a new tool, which is not a pickaxe or shovel but a new tool called a chisel. if you use the chisel on the emerald block how you would normally use a pickaxe on a coal ore, you get an emerald crystal.
So if anyone can explain to me how to do this, it will be greatly appreciated
I made a new block, emerald block, and i want to create a new tool, which is not a pickaxe or shovel but a new tool called a chisel. if you use the chisel on the emerald block how you would normally use a pickaxe on a coal ore, you get an emerald crystal.
So if anyone can explain to me how to do this, it will be greatly appreciated
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: [unanswered] making new materials and tools
hmmm well I will look into this and will give you the code if needs be I suggest looking the enum tool files to then declare a new tool and its affinitys I will give you the code as soon as I can
Re: [unanswered] making new materials and tools
Thanks! I just got help from Jayden on skype and he gave me this code on the Blocknamehere class
- Code:
public int idDropped(int i, Random random)
{
if(blockID == mod_jasper.chisel.shiftedIndex)
{
return mod_jasper.lapiscrystal.shiftedIndex;
}
else
{
return blockID;
}
}
public int quantityDropped(Random random)
{
return 1;
}
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: [unanswered] making new materials and tools
omfg I cant post in the code sorry about this anyway if you want an efficent code that means you have the item already coded without having to make major changes to the block use the code in ItemSpade.java or Itempickaxe.java
Re: [unanswered] making new materials and tools
the code in ItemSpade.java
i am not sure what to do with this.. well i could change the blocksEffectiveAgainst and the part with the snow, but i need some help here xD
- Code:
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// ItemTool, Block, EnumToolMaterial
public class ItemSpade extends ItemTool
{
public ItemSpade(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, 1, enumtoolmaterial, blocksEffectiveAgainst);
}
public boolean canHarvestBlock(Block block)
{
if(block == Block.snow)
{
return true;
}
return block == Block.blockSnow;
}
private static Block blocksEffectiveAgainst[];
static
{
blocksEffectiveAgainst = (new Block[] {
Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField
});
}
}
i am not sure what to do with this.. well i could change the blocksEffectiveAgainst and the part with the snow, but i need some help here xD
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: [unanswered] making new materials and tools
I think you can take the shovel, change the blocks effective against and just do yours.... but what are the exact specifications? is it you can only receive the ore from using the chisel?
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: [unanswered] making new materials and tools
no i have a block called emeraldblock. if you mine it using a chisel you will get a emeraldcrystal (item), if you mine it with a pickaxe you will get 4 emerald(item), if you mine it with anything else you will get nothing.
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: [unanswered] making new materials and tools
ahhhh I see... I'll try to figure something out, just to help my modding skills xD
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: [unanswered] making new materials and tools
nope xD... I'll keep trying though
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: [unanswered] making new materials and tools
Well i figured i find it too hard to do it my way.. so now i want to make it so when you right click a emerald block or lapischunk with a chisel you get a emerald crystal or lapis crystal according on which block it is.
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: [unanswered] making new materials and tools
yeah I could probably do that by making them act as shears, basically.
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: [unanswered] making new materials and tools
I tried to mess around with the code in ItemShears.java
but i cant figure it out xD i hope you can :S
but i cant figure it out xD i hope you can :S
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: [unanswered] making new materials and tools
haha yeah same problem. i think it's actually what goes in to the block section that makes it work... I'll keep trying
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: [unanswered] making new materials and tools
I hope youll have more success then me.. also i owe you 100 diamonds when you succeed xD
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: [unanswered] making new materials and tools
I think I'm on to something here...
- Code:
public boolean interact(EntityPlayer entityplayer)
{
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
if(itemstack != null && itemstack.itemID == Item.chisel.shiftedIndex && !getChiseled())
{
setChiseled(true);
int i = 2 + rand.nextInt(1);
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: [unanswered] making new materials and tools
that's the section I pulled from the sheep that i thought might help
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: [unanswered] making new materials and tools
Ok I think I'm getting something. It's weird putting the code together though
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: [unanswered] making new materials and tools
This might or might not be what we need.. xD ill try to mess with it a bit in a while...
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Re: [unanswered] making new materials and tools
yeah I can't get it figured out but I definitely think it has something to do with that.
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: [unanswered] making new materials and tools
haha this guy^ Man you're awesome!
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: [unanswered] making new materials and tools
i got it working due to Jaydenbadboii
ikke009- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Page 1 of 2 • 1, 2
Similar topics
» [Unanswered] Making New Minecraft Dimension
» [1.1] tools set
» [Request} Special Tools
» [Answered/Solved] Making custom mobs fly
» Making a Furnace-like Block
» [1.1] tools set
» [Request} Special Tools
» [Answered/Solved] Making custom mobs fly
» Making a Furnace-like Block
MC Modding :: Modding :: Singleplayer Modding :: Requests
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum