Jump to content

Recommended Posts

Posted

I'm working on a mob which is essentially just a rescaled & re-textured zombie with some extra features and AI tweaks, the problem is that like zombies it spawns minus its head every so often and I can't seem to figure out which function is responsible, I'd like to be able to override it so that my mob never spawns without a head.

 

I've been over the zombie render and entity classes multiple times and its driving me nuts, can anyone point me in the right direction?

Posted

You misunderstand me, the question relates to identifying which function in the vanilla code causes some zombies to render without a head, my own code (and texture map) is not relevant.

 

Although you did give me an idea... if the headless zombies are actually rendering a head but offsetting the texture for the head box to a blank part of the texture map then adding an 'extra head' to the correct part of the texture map might be a reasonable workaround... although it would be more efficient and tidy to just override the responsible function if I can pin it down. Something to think about, so thanks :)

 

Edit:

 

Yep that's what's going on, somewhere in a zombie class (presumably render)  a function is randomly applying an offset to the texture in regards to the head box, just need to find it now!

 

Ok so, basically to get around this by stacking the texture (making a copy directly below), trimming off everything except the head, and then shifting the extra head down by 2 pixels for a vanilla 16x texture, 4 pixels for a 32x texture etc.

 

You can even use this method, as I now intend to do, to make your mob occasionally have an alternative head! Although I'm still interested in finding the function that is responsible for randomly applying the offset.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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