Custom Items
Minecraft: Java Edition supports creating "custom" items that are based on vanilla items. With Minecraft 1.21.4+, the introduction of item components further allows the customization of item behavior on a per-item-stack basis, such as changing the visual appearance using the item model component, and modifying item properties such as the ability to eat or equip an item.
Unlike Java Edition, Bedrock natively supports adding custom items that are not based on vanilla items. However, Bedrock does not support extending vanilla items or modifying vanilla item behavior. Therefore, Geyser has a mapping system that allows mapping custom Bedrock items to modified vanilla Java items. Geyser further supports mapping custom Bedrock items to modded non-vanilla items which would normally require mods to be installed on the Java client.
To set up custom items in Geyser, you have to choose how you are going to register your items. The easiest is using a json mapping file, but you can also use a Geyser extension which uses the Geyser API. Further, a Bedrock edition resource pack must also be supplied to ensure Bedrock players can see custom items.
Geyser does not convert resource packs from Java Edition, and also does not generate custom item mappings automatically. However, you can use automatic tools such as Rainbow to make converting content simpler.
Since the Geyser API version 2.9.3 (Build #1062 and up), the old custom item format (v1) is deprecated and is no longer being updated. Old docs can still be found here
Custom items (v2)
Geyser supports mapping items using item_model and item component features introduced in 1.21.4+. The previous custom-model-data approach continues to be supported using legacy definitions.
However, there are some caveats. Unlike Java Edition, Bedrock Edition does not support modifying item properties dynamically at runtime (e.g. making dirt edible with a command).
For such use-cases, Geyser supports a predicate system which allows registering multiple custom Bedrock items with different properties to map
to different item stacks with specific components.
How does it work?
"Custom" items in Java edition are based on vanilla items, with a modified appearance (using item models on 1.21.4+, or custom model data on older versions). Therefore, all mapped Bedrock custom item definitions are based on vanilla Java items and their components. Further, mapped definitions can specify additional components to modify the items' behavior.
Prerequisites: Vocabulary
Java item: Any vanilla item that exists in the Minecraft: Java Edition base game. Java datapacks / plugins can create custom items by overriding components of a Java item.Java item component: On Java Edition since 1.21.4+, items have their properties and behavior defined using item components. Every Java item has a set of default components, which can be overridden to change how an item looks or functions.Bedrock item component: Custom Bedrock items also have components that determine item behavior, similar to Java Edition. However, these components cannot be changed at runtime for item stacks and have to be pre-defined when the Bedrock client joins.Java legacy custom model data: The system used before Java 1.21.4. Before 1.21.4, each "custom item" had a custom model data number, used to decide which model a Java item should use (= different texture for players).Java item model definition: Introduced in Java 1.21.4, they are found in theassets/<namespace>/items/directory of Java resource packs. These textures are used to set the appearance of Java items, and can be dynamically changed with a set of rules and item properties. Every Java item stores its item model definition in theminecraft:item_modelitem data component. It can be overridden on a per-item-stack-basis by a datapack/plugin to use a custom item model definition defined in a resource pack.Custom item definition: a custom item definition is a Geyser term. It represents a single Bedrock custom item that is used to map a Java item model definition. It contains info on the item's properties on Java and Bedrock. Multiple custom item definitions, and thus multiple Bedrock items, can exist for the same Java item model definition, but for every combination of a Java item and Java item model definition, there can only be one custom item definition without predicates.Non-vanilla custom item definition: also a Geyser term. Represents a Bedrock custom item that maps a Java non-vanilla (modded) item. Like normal custom item definitions, it contains info on the item's properties on Java and Bedrock. At the moment, there can only be one non-vanilla custom item definition per Java non-vanilla item.
Definitions
Every custom item definition represents one custom Bedrock item that has a specific set of pre-defined Bedrock options. It is tied to a specific Java item + item model combination (or, for legacy items, a specific Java item + custom model data combination).
Mandatory definition properties
bedrock_identifier: This identifier is used for the custom Bedrock item (and also in e.g. attachables in Bedrock resource packs), and cannot be shared with any other custom item definition. This identifier cannot be in theminecraftnamespace. If no namespace is provided,geyser_customis used.model(orcustom_model_dataforlegacydefinitions in json mappings) is also required.
Optional definition properties
display_name: A string, or json text component for the item's default display name. If not set, it is derived from the bedrock identifier.bedrock_options: The bedrock options that specify additional Bedrock propertiescomponents: Java item components that specify item behavior, such as the maximum stack size.predicate: Predicates used to match a specific custom item definition to an item stack.predicate_strategy: Specifies how multiple predicates are evaluated. Only used when predicates are specified.priority: Optionally specifies a priority of a definition over other definitions for the same item + item model combination. Only used when there are multiple custom item definitions.
- Definitions: Json mappings
- Definitions: Geyser API
Json mapping files have to specify the format_version set to 2, and list all definitions for each item
under the items key. It holds an object in which keys are Java items, and in which each value is an array of objects,
specifying custom item definitions for that Java item.
Example structure of a mappings.json mappings file:
{
"format_version": 2,
"items": {
"minecraft:flint": [
// definition
],
"minecraft:apple": [
// definition1,
// definition2
],
"minecraft:diamond": [
// definition
]
}
}
There are multiple types of custom item definitions:
definition: a single custom item, defined for a Java item model definition.legacy: a single custom item, defined for a Java custom item making use of legacy custom model data numbers.group: a group of custom item definitions. The type of a definition is defined in thetypekey.
- Item Model Definition (1.21.4+)
- Group Definition
- Legacy Definition (pre 1.21.4+)
{
"type": "definition",
"model": "example:example_model",
"bedrock_identifier": "example:example_item"
}
The definition type is used to map one definition for a specific item's item_model component value.
This should be used for 1.21.4+ and above. For custom items using the legacy custom_model_data format,
use the legacy type.
{
"type": "group",
"model": "example:example_model", // Optional, can be set per-definition
"definitions": [...]
}