Jump to content

1.9. Giving textures with different color based on a grayscale (Like Spawn Eggs)


Recommended Posts

Posted

Hello, I have been making this spawner stick that throws an egg, but I can't seem to find a way to make the stick have a different color on the texture based on what parameters are passed in. I have looked throughout all of the source of minecraft, and I couldn't find how spawn eggs are given different textures. And to clarify, I am trying to use a gray-scaled, two-layered model, and changing the color scheme of it, and by giving it a different parameter, I can get a different colored texture with the same look.

Posted

You'll need to create a class that implements IItemColor and register it with the ItemColors class, there's a getter for ItemColors in Minecraft(The class) . Do not ever reference your IItemColor server-side, IItemColor is client-side only so it does not exist in the server .jar.

 

Posted

Your

IItemColor#getColorFromItemstack

implementation receives a tint index argument telling it which part of the model is being coloured. This also applies to

IBlockColor

, which is used to colour blocks.

 

For regular models, the tint index is specified per face of each element.

 

For models that extend

builtin/generated

(or

item/generated

, which extends

builtin/generated

), the tint index is the texture's layer number (0 for the

layer0

texture).

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.