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'm trying to make a block (with TileEntity) that uses a different model depending on its NBT.

Can anyone point me in a direction, I'm not sure where to start. I've done the same for items, but never for blocks.

Edited by Tschipp

1 minute ago, Tschipp said:

a block that uses a different model depending on its NBT.

Blocks do not have any NBT data associated with them. Do you mean ItemBlocks or TileEntities?

ItemBlocks are not different from regular items in this regard.

You can use Block::getActualState to return an IBlockState that relies on something like a TileEntity to define values for some of it's properties. See BlockFlowerPot for more details and an example.

  • Author
1 minute ago, V0idWa1k3r said:

Blocks do not have any NBT data associated with them. Do you mean ItemBlocks or TileEntities?

ItemBlocks are not different from regular items in this regard.

You can use Block::getActualState to return an IBlockState that relies on something like a TileEntity to define values for some of it's properties. See BlockFlowerPot for more details and an example.

Yeah sorry I meant TileEntities... long day

  • Author
3 minutes ago, diesieben07 said:

You can put whatever data you need from the TileEntity into the block state either using getActualState (if the amount of states is enumerable) or getExtendedState (for this you will need a custom runtime model).

I don't think I can use states, I'm making a block that can look like any other block. The tile entity stores a Blockstate value and the block is supposed to look like that blockstate

Edited by Tschipp

  • Author
2 minutes ago, diesieben07 said:

Then you need getExtendedState with unlisted properties and a custom runtime model.

Ok, how do I make a runtime model?

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.