Jump to content

[1.19.2] Change entity color


DirtEngineer

Recommended Posts

  • 2 weeks later...

That would be relatively simple, but there is a little twist.
1.  It is a projectile, not a living entity.
2. The projectile holds any one of several custom fluids, the color of which is impossible to determine until runtime.

Being a projectile that is removed from the game within a few ticks of impact, I don't have to be concerned with unsetting the color change.

I do have a minimal custom renderer that extends ArrowRenderer.  Perhaps I could override the render method in EntityRenderer.
One concern is that, due to the singleton nature of items, blocks, entities, it may cause every one of these currently in the game to be tinted the same way.  It would seem to be a bit of overkill to make a custom capability just for this minor effect.  But, if that is what it takes, I'm up for it.

Reality check: am I even approaching it correctly?

Link to comment
Share on other sites

On 12/30/2022 at 2:29 PM, DirtEngineer said:

It is a projectile, not a living entity.

Why would this matter? Textures get applied the same way, same as the color.

On 12/30/2022 at 2:29 PM, DirtEngineer said:

The projectile holds any one of several custom fluids, the color of which is impossible to determine until runtime.

Ok? So you can pass the color into the texture shader and tint it instead.

On 12/30/2022 at 2:29 PM, DirtEngineer said:

I do have a minimal custom renderer that extends ArrowRenderer.  Perhaps I could override the render method in EntityRenderer.
One concern is that, due to the singleton nature of items, blocks, entities, it may cause every one of these currently in the game to be tinted the same way.  It would seem to be a bit of overkill to make a custom capability just for this minor effect.  But, if that is what it takes, I'm up for it.

This is not going to do that? The only way that would happen is if you're replacing every single render call to have your color tinting it, which since you have control over what you render, is completely unnecessary.

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.



×
×
  • Create New...

Important Information

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