Posted August 13, 20214 yr I just recently switched from the beta 1.17.1 to the current release one. I am not getting how to use ToolAction (as it has replaced tooltype) to assign what tool type is needed to break the custom blocks. Where do i put that, and how do you assign the mining level needed? I'm not seeing it and I can't seem to find it via digging through the ida in the project.
August 13, 20214 yr this is now tag based, take a look at this thread Edited August 13, 20214 yr by Luis_ST
August 13, 20214 yr Could you show us an example? I also have the same doubt and the truth is I can't find a way to solve it, besides the other thread doesn't give me ideas about anything either.
August 13, 20214 yr public class ModBlocks { public static final DeferredRegister<Block> BLOCKS; public static final RegistryObjet<Block> KYPTOITE_ORE; public ModBlocks{} static { BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, "gworld"); KYPTOITE_ORE = BLOCKS.register("kyptoite_ore", () -> { return new KyptoiteOre(Properties.of(Material.STONE).destroyTime(5).explosionResistance(1000) .sound(SoundType.STONE).requieresCorrectToolForDrops()); }); } } Normally there would be the options of "harvestTool" and "harvestLevel", since I plan to add a great variety of ores, I mean, peaks for better minerals than diamond and I want to add for example "harvestLevel" at level 5, before they were, I was developing the mod on 37.0.26, but that version had a bug with the "loot_tables", so I opted to update my project and now I'm stuck for that. (The project is in forge 37.0.33)
August 13, 20214 yr I know that with the new updates those same parameters were changed, since I tried to solve my problem by reading the changelog, but no option that resembles it appears, they seem totally eliminated.
August 13, 20214 yr harvestTool is now set in json which i had explained in this thread harvestLevel is also set via json but it's a bit more complicated, you need to create a custom block tag and add your block to this tag if you create an ItemTier wich can mine the block you should return the tag in the ItemTier (take look at the ForgeTier and at the TierSortingRegistry class), for tags look into the vanilla Tags classes
August 13, 20214 yr I see, I assure you that this answer is much better than the previous one, I have been used to adding those parameters in the properties of the block for two years, so it did not occur to me, thank you very much for the answers.
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.