Posted June 14, 20205 yr Hi. I need to use more texture layers for my item, but only 5 layers will load. Minecraft minecraft = Minecraft.getInstance(); ItemColors colors = minecraft.getItemColors(); colors.register((p_210242_0_, p_210242_1_) -> { if(p_210242_0_.getItem() == ItemInit.LABEL.get()) { return ((LabelItem) p_210242_0_.getItem()).getColor(p_210242_0_, p_210242_1_); } return -1; }, ItemInit.LABEL.get()); Item json: { "parent": "item/generated", "textures": { "layer0": "realistic_beer_brewing:items/label/layer0", "layer1": "realistic_beer_brewing:items/label/layer1", "layer2": "realistic_beer_brewing:items/label/layer2", "layer3": "realistic_beer_brewing:items/label/layer3", "layer4": "realistic_beer_brewing:items/label/layer4", "layer5": "realistic_beer_brewing:items/label/layer5", "layer6": "realistic_beer_brewing:items/label/layer6", "layer7": "realistic_beer_brewing:items/label/layer7", "layer8": "realistic_beer_brewing:items/label/layer8" } } Is the number of layers limited or why doesn't it work for me?
June 14, 20205 yr // ItemModelGenerator.class, MC version 1.15.2, mappings 20200514-1.15.1 public static final List<String> LAYERS = Lists.newArrayList("layer0", "layer1", "layer2", "layer3", "layer4"); It seems coded for 5 item layers. But, as Lists.newArrayList "creates a mutable ArrayList instance", you might be able to add more layers manually.
June 14, 20205 yr Oh, and don't call Minecraft#getItemColors(). Register a listener for ColorHandlerEvent.Item (make sure to register only on the client side).
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.