StefanDeSterke Posted July 20, 2020 Posted July 20, 2020 Hi! So I coded a block with harvest level 3 and tooltype pickaxe, but for some reason it still drops its loot table when I mine it with a tool that has harvest level 2 (for example an iron pickaxe). It even ignores the tooltype, because if you mine it with for instance a diamond shovel it still drops. I only want it to drop when mined with a diamond pickaxe or a netherite pickaxe. Here's my code: @SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll( new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(6f, 2000f).harvestTool(ToolType.PICKAXE).harvestLevel(3)).setRegistryName(location("blaststone_ore")) ); } If someone has a solution to this, that would be greatly appreciated. Thanks! Quote
ChampionAsh5357 Posted July 20, 2020 Posted July 20, 2020 What version of forge are you using? This did not work up until 32.0.55 I believe. Quote
StefanDeSterke Posted July 20, 2020 Author Posted July 20, 2020 I'm using the latest version, 32.0.70 Quote
ChampionAsh5357 Posted July 20, 2020 Posted July 20, 2020 Oh wait. You have to call setRequiresTool or func_235861_h_ in your block properties depending on your mapping version. 1 Quote
StefanDeSterke Posted July 20, 2020 Author Posted July 20, 2020 3 minutes ago, ChampionAsh5357 said: Oh wait. You have to call setRequiresTool or func_235861_h_ in your block properties depending on your mapping version. Ah ok thanks! This works! Quote
Ben Newman Posted January 22, 2021 Posted January 22, 2021 Where do I add the setRequiresTools i really need to know as I cannot find where to code it. Many thanks. Quote
Luis_ST Posted January 22, 2021 Posted January 22, 2021 1 hour ago, Ben Newman said: Where do I add the setRequiresTools i really need to know as I cannot find where to code it. Many thanks. Add it to your block properties: public YourBlock() { super(Block.Properties.create(Material.ROCK) .hardnessAndResistance(3.5f) .sound(SoundType.STONE) .harvestTool(ToolType.PICKAXE) .setRequiresTool()); } Quote
Recommended Posts
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.