Posted July 4, 201411 yr I have made an ore block, and it generates throughout my world, but any type of pickaxe can mine it. How can I set it to Iron?
July 4, 201411 yr Have a look at setHarvestLevel(String toolClass, int level, int metadata) in Block.java.
July 4, 201411 yr You should be able to call the method from your Block constructor, or chain it where you initialise the Block. For example, this is how you would set your Block to only be harvestable using an Iron Pickaxe or better: setHarvestLevel("pickaxe", 2); I hope you can make it work
July 4, 201411 yr Umm i have a question how would i get it to only be able to be broken by a specific item/tool
July 4, 201411 yr setHarvestLevel("shovel", 3); Only diamond shovels will be able to harvest this. Or do you mean just breaking the block without it dropping anything? If that is the case, please make a new thread
July 4, 201411 yr I mean for example i have a ore call "testOre" And an item call "testItem" how could i get ONLY testItem to break testOre and get the drop
July 4, 201411 yr Will the block be completely unbreakable (bedrock-like) if the player is not using "testItem"?
July 4, 201411 yr Im not sure yet but to get the drop you need x-tool (i would also like to know how to vary the drop based on enchantment/tool/item)
July 4, 201411 yr Either way, you will want to extend ItemTool and set the value of the field toolClass to "testitem", then use "testitem" as the parameter for setHarvestLevel.
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.