Jump to content

[1.16.5] Help with spawning a horse with specific type/ coat?


Recommended Posts

Posted

Hello everyone! New to the modding community and the forums, but I'll go ahead and get right to it:

I'm trying to make a mod that allows me to spawn a horse with specific variants set (i.e. the coat color and coat type).

I've been combing through the horse code for a while, and it seems like anything that would allow be to do this has been blocked off. The main function I'd want to use, setVariantAndMarkings() in the HorseEntity class, is private. I've tried replicating what the function itself does, but it relies on more private information (it has to set the entitydata using a unique id defined privately at the top of the class: DATA_ID_TYPE_VARIANT).

Does anyone know of any way I could get around these roadblocks? I've been trying out various approaches for hours now to no avail. If any more info is needed feel free to ask and I'll happily provide some.

Any help would be greatly appreciated! Thanks!

Posted

Found a solution! To anyone who may wonder in the future, I ended up using the readAdditionalSaveData function of the HorseEntity class, and passed in a compoundNBT tag with the Variant value already calculated.

In the future if anyone has any other questions on this topic, go ahead and post them here!

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.