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.

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

Featured Replies

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.

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.

 

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

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.