Mojira Archive
MC-279132

Negative `tintindex` in block models causes `ArrayIndexOutOfBoundsException`

A custom block model with a negative tintindex causes an ArrayIndexOutOfBoundsException if the player try to render said block in an inventory.

Steps to Reproduce:

  1. Start the game;
  2. Load the attached resource pack;
  3. Open or create a world in creative;
  4. Search for "leaves" in the creative inventory;
  5. The game will freeze, then crash.

Context
This bug was encountered by some forum users playing on modified servers, but still reproduces on the vanilla single-player game:

Suggested Fix

// net.minecraft.client.renderer.entity.ItemRenderer

private static int getLayerColorSafe(int[] tintLayers, int index) {
    return index >= tintLayers.length ? -1 : tintLayers[index];
    //     ^ index < 0 ||
}

Fixed

uyaeuyeiueaeuaeu

2025-01-03, 10:04 PM

2025-01-07, 08:31 AM

2025-01-07, 08:31 AM

0

1

Confirmed

Crash, Resource Packs

1.21.4

25w02a