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

 

simpleBlock(ModBlocks.SILVER_BLOCK.get());

is easy, created all faced block of the same texture.

 

But..how do I do that with grass block that has custom properties

{
    "parent": "block/grass_block",
    "textures": {
      "particle": "modid:block/dirt",
      "side": "modid:block/grass_side",
      "top": "modid:block/grass_block_top",
      "bottom": "modid:block/dirt",
      "overlay": "modid:block/grass_side"
    }
  }

 

I encourage you to look at the code for the BlockStateProvider class and the simpleBlock method, see the helper functions and what they call internally

 

simpleBlock simply defines a model for a Block regardless of blockstate.

so if it is a grass block that you want to make: it doesn't have a block state, you use the simpleBlock method

 

if you only give the simpleBlock one parameter, a block, it generates a model with all faces with the same texture

if that's not what you want tho, you can pass a custom model as the second parameter

you can call models() to get the default BlockModelProvider, it has a bunch of methods for the common model files

the one that you want is the BlockModelProvider#cubeBottomTop()

  • Author
12 minutes ago, kiou.23 said:

I encourage you to look at the code for the BlockStateProvider class and the simpleBlock method, see the helper functions and what they call internally

 

simpleBlock simply defines a model for a Block regardless of blockstate.

so if it is a grass block that you want to make: it doesn't have a block state, you use the simpleBlock method

 

if you only give the simpleBlock one parameter, a block, it generates a model with all faces with the same texture

if that's not what you want tho, you can pass a custom model as the second parameter

you can call models() to get the default BlockModelProvider, it has a bunch of methods for the common model files

the one that you want is the BlockModelProvider#cubeBottomTop()

Thanks! thats what I was missing, I found the cubebottomtop and didnt understand why it said I'm missing a model, I will try that 

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.