Jump to content

[1.19.2] How to set visibility of Geckolib geo.json part?


Darwinagain

Recommended Posts

I am using Geckolib to create custom entities, but I want to be able to enable/disable certain parts based on criteria. For example, a saddle layer would only show if the entity `isSaddled()`. I'm just not sure how to access individual model parts using the geo.json files.
For now, I have created two separate models and I swap them based on the `object.isSaddled() method`:
 

@Override public ResourceLocation getModelResource(MyModdedEntity object) {

return MODELS[object.isSaddled() ? 1 : 0];

}
Edited by Darwinagain
adding codeblock
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.

Announcements



×
×
  • Create New...

Important Information

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