Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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?

Well it is difficult to help you without code (and in this case, the texture maps might also be useful)

Power, even in the Darkness, Courage shall prevail

  • Author

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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.