Jump to content

Recommended Posts

Posted

I'm trying to use data generation to create blockstates and block models. I'm a little stuck on generating my block's item model. I'm trying to make it inherit from the block model, but the data generator seems to be assuming it should instead inherit from an item model. This essentially results in the item model inheriting from itself instead of from the corresponding block model.

Here's my BlockStateProvider and the resulting item model. What am I missing?

Posted

You don't need to use itemModels there, you need to use a ModelFile of the Block.
You can use a ExistingModelFile or a UncheckedModelFile depends on whether the Block model has already been generated or not.
You can get the location for the ModelFile from #blockTexture.

  • Like 1
Posted

Thank you, that worked!. It took me a minute to figure out how to use an ExistingModelFile. For future readers, you can get one through models().getExistingFile and passing in the resource location of the block 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...

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

Announcements



×
×
  • Create New...

Important Information

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