Jump to content

Data generation grass block


spicycrap

Recommended Posts

 

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"
    }
  }

 

Link to comment
Share on other sites

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()

Link to comment
Share on other sites

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 

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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