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

Hi

 

I would like to make some vanilla blocks water loggable, how would I go about doing that? I have to add the property WATERLOGGED to the block first, then I have to add the IWaterLoggable interface together with its methods. Making my own block class adding that is super easy, but adding it to vanilla blocks  I have no idea how to do.

  • Author
2 hours ago, diesieben07 said:

You need to replace the registry entries for the blocks. Basically just give your own block instance the same registry name of the one you want to overwrite.

Note that:

  1. Only one mod can do this per block (obviously).
  2. Your block cannot change the block state properties of the original block, because that would break world saves.

 

Ok, so tried that, but it ended up with it complaining that I can't change the order of block properties, so I changed the order of it, same thing. Then I removed it just to see what it said then and then the game crashed due to it not finding the waterlogged property on the block.

 

@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder)
{
    super.fillStateContainer(builder); // Doesn't matter which order they are in, still complains. Removing WATERLOGGED crashes the game.
    builder.add(WATERLOGGED);
}

 

How do I avoid that?

  • Author
2 hours ago, diesieben07 said:

Your block cannot change the block state properties of the original block, because that would break world saves.

Or do you mean by that I can't add new properties to it? I thought you meant I can't remove existing block properties or change how they behave and the range of example an int range.

19 minutes ago, Simon_kungen said:

Or do you mean by that I can't add new properties to it? I thought you meant I can't remove existing block properties or change how they behave and the range of example an int range.

You can't CHANGE them. That means no adding, no removing.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
9 minutes ago, Draco18s said:

You can't CHANGE them. That means no adding, no removing.

Hmm... so my best bet is to just make a new block under my mod id and replace the vanilla block recipe to give my block instead?

  • Author

Ok, so I have made so it uses the parent models of the original vanilla block + item. How do I replace an item in its Creative Tab with my version? So players will be encouraged to use my version.

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.