Posted July 20, 20205 yr 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!
July 20, 20205 yr Oh wait. You have to call setRequiresTool or func_235861_h_ in your block properties depending on your mapping version.
July 20, 20205 yr Author 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!
January 22, 20214 yr Where do I add the setRequiresTools i really need to know as I cannot find where to code it. Many thanks.
January 22, 20214 yr 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()); }
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.