Posted August 7, 201411 yr What is the material obsidian uses? I want to add a new ore to the game that can only be mined with a diamond pickaxe but what ever material I set it as I can mine it with all the pickaxes. I even set the resistance to 2000.0F but that does not help ether.
August 7, 201411 yr I don't have an answer for you but resistance controls if it can be destroyed by creepers, ghast fireballs, tnt, wither blasts, etc... I like trains.
August 7, 201411 yr The material doesn't affect whether or not you can mine the block. What you are looking for is this code: this.setHarvestLevel("pickaxe", 3); It goes in the block's constructor. If I helped please press the Thank You button. Check out my mods at http://www.curse.com/users/The_Fireplace/projects
August 7, 201411 yr You would need to use something such as: this.isToolEffective(type, metadata); To set that tool(although im not sure how to get the type of pick but when i find that i will tell you) ~Drok
August 7, 201411 yr Author I am having a new problem now. I was using miecraft code from the blocks classes to test out my block and I was just having it drop 2 clay balls. But now I have my own custom item that I want it to drop. How do I make it drop 2 of my Itemcristal on destruction?
August 7, 201411 yr getItemDropped and getQuantityDropped. BEFORE ASKING FOR HELP READ THE EAQ! I'll help if I can. Apologies if I do something obviously stupid. If you don't know basic Java yet, go and follow these tutorials.
August 8, 201411 yr You need to return the Item you want dropped and an integer of how much. Don't forget to use @Override to make sure you typed the method names and signature correctly. BEFORE ASKING FOR HELP READ THE EAQ! I'll help if I can. Apologies if I do something obviously stupid. If you don't know basic Java yet, go and follow these tutorials.
August 9, 201411 yr Author Ok this is my code for the ore. As you can see I want to have it drop Itemcristal that is my item that I added to the game. I want it to 2 of them but it is not excepting my item. I have the cristal.java imported and my main java imported(cristalore.java). But it will not except Itemcristal package net.Cristalore.mod.ore; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.Cristalore.mod.cristalore; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.Cristalore.mod.items.cristal; public class Cristaloreblock extends Block { public Cristaloreblock(Material material) { super(material); this.setHardness(10.0F); this.setResistance(2000.0F); this.setHarvestLevel("pickaxe", 3); this.setStepSound(soundTypePiston); this.setCreativeTab(CreativeTabs.tabBlock);} public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return Itemcristal; } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random p_149745_1_) { return 2; } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister){ this.blockIcon = iconRegister.registerIcon(cristalore.modid + ":" + this.getUnlocalizedName().substring(5)); } }
August 9, 201411 yr Try public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return MainModFile.Itemcristal; }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.