Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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.

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)

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.

 

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.