ItemsDefinition

public final class ItemsDefinition extends Record

One parsed Java 1.21.4+ items definition file (e.g. assets/elitemobs/items/gear/bronze_sword.json).

Parameters

namespace

the asset namespace (e.g. "elitemobs")

itemsRelPath

the relative path within items/ without extension (e.g. "gear/bronze_sword")

file

the actual file on disk

root

parsed JSON contents

explicitBaseItems

exact base Java item ids when the source format declares them

legacyCustomModelData

the exact pre-1.21.4 custom-model-data value, or null for a modern item-model definition

Constructors

Link copied to clipboard
public void ItemsDefinition(String namespace, String itemsRelPath, File file, JsonObject root)
public void ItemsDefinition(String namespace, String itemsRelPath, File file, JsonObject root, List<String> explicitBaseItems)
public void ItemsDefinition(String namespace, String itemsRelPath, File file, JsonObject root, List<String> explicitBaseItems, BigDecimal legacyCustomModelData)

Functions

Link copied to clipboard
public boolean hasExplicitBaseItems()
Link copied to clipboard
public boolean isLegacyCustomModelData()
Link copied to clipboard
public boolean isRootVanillaItem()
True for assets/minecraft/items/<item>.json, which names the vanilla Java item it redefines rather than a custom item model.
Link copied to clipboard
public String itemIdentifier()
The fully-qualified Java item-model identifier this definition declares.
Link copied to clipboard
public static ItemsDefinition legacyCustomModelData(String namespace, String itemsRelPath, File file, JsonObject root, String baseItem, BigDecimal customModelData)

Inherited functions

Link copied to clipboard
public abstract boolean equals(Object p)
Link copied to clipboard
public abstract int hashCode()
Link copied to clipboard
public abstract String toString()