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'd like to render the Ender Dragon with a new texture. Is it possible for me to use a Forge event that every time the Ender dragon is called(constucted) I can bind my custom texxture? A little help.

Hi

 

Unfortunately I think the answer is almost certainly "no".

 

But you could copy the Ender Dragon to a set of new classes and change the textures to whatever you want.

 

Won't be easy, the dragon is complicated.

 

-TGG

Wouldnt it be possible to extend the renderer class(s) and override the method that sets the texture? It makes sence to me that it would work, but i could be overlooking something.

  • Author

That's exactly what I was thinking. That I could just hook into the Ender Dragon Render class and when ever it is called just bind my custom texture.

The question is a bit ... confusing. ;)

 

Construction of a mob's models happens at most twice during the game run: Once into Minecraft's internal representation of it (during the constructor call of its Model) and once when the model first has to be rendered, into graphic card memory (in compileDisplayList(float) of its ModelRenderers). Neither of them involve any texture binding.

 

Texture binding (for mobs) happens once per frame the entity is to be rendered in renderModel(EntityLivingBase, float, float, float, float, float, float) (actually more of a renderModel(<? extends EntityLivingBase>, float, float, float, float, float, float)  in original code, but we don't get the generics decompiled properly right now) of the entity's renderer, and it typically binds whatever ResourceLocation gets returned from getEntityTexture(Entity) of the entity's renderer returns (though the Ender Dragon specifically also some extra code for the "dying" textures).

 

There are no hooks or events you can set anywhere in code to manipulate that. Your best - least invasive, at least - bet would be to do a coremod and exchange RenderDragon's protected ResourceLocation getEntityTexture(Entity) method with your own. More complicated (in terms of the amount of code needed) would be to @ForgeSubscribe to the RenderLivingEvent.Pre event and do the whole dragon rendering yourself, preventing the original renderer from even running (event.setCanceled(true)).

ItemBlock is not a Block

ItemStack is not an Item

Damage value is not metadata

 

Stop confusing them.

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

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.