Skip to main content

Minecraft Data Types

These are data types defined by Minecraft that are used in Origins JSON files. Understanding them is useful for working with powers, actions, and conditions.


Item Stack

An Item Stack is the JSON representation of one or more items. It contains the item ID, count, and optional data components (which replaced NBT in 1.20.5+).

FieldTypeDefaultDescription
idIdentifierrequiredItem ID (e.g. minecraft:diamond_sword)
countInteger1Number of items (1~64)
componentsObjectoptionalData component map
warning

If you upgrade your pack from 1.20.4 or earlier, you must convert all item stacks to the new format. The old nbt field is no longer supported and must be replaced with components.

Example:

{
"id": "minecraft:diamond_sword",
"count": 1,
"components": {
"minecraft:enchantments": {
"levels": {
"minecraft:sharpness": 5
}
}
}
}

Damage Type

A Damage Type is referenced by its Identifier from the damage_type registry (data/<namespace>/damage_type/). When a field's type is DamageType, you provide the Identifier that points to a damage type definition.

Example:

"damage_type": "minecraft:in_wall"

Damage types are defined in data packs at data/<namespace>/damage_type/ and specify properties like whether the damage bypasses armor, counts as fire, etc. For a list of common damage type IDs, see Minecraft Wiki: Damage Type.

A Damage Type JSON definition:

FieldTypeDefaultDescription
message_idStringrequiredTranslation key for the death message
exhaustionFloat0.0Hunger exhaustion caused
scalingStringwhen_caused_by_living_non_playernever, always, or when_caused_by_living_non_player
effectsStringhurthurt, thorns, drowning, burning, poking, or freezing
death_message_typeStringdefaultdefault, fall_variants, or intentional_game_design

Equipment Slot Group

An Equipment Slot Group specifies which equipment slot(s) an item occupies. It can be a single slot or a group.

Valid values for EquipmentSlotGroup:

ValueDescription
anyAny equipment slot
handEither hand (mainhand or offhand)
armorAny armor slot
headHead armor slot
chestChest armor slot
legsLegs armor slot
feetFeet armor slot
mainhandMain hand only
offhandOff-hand only
bodyBody slot (horse armor, wolf armor, etc.)

Text Component

A Text Component is Minecraft's rich text format used for messages, tooltips, and titles. It can be a plain string or a complex JSON object.

Simple string:

"message": "Hello World!"

Styled text:

{
"text": "Hello",
"color": "gold",
"bold": true
}

Translatable text:

{
"translate": "origins.gui.choose_origin.title",
"fallback": "Choose your Origin"
}

For full documentation, see Minecraft Wiki: Raw JSON text format.


note

In this mod, if you use a simple string where a Text Component is expected, it will be automatically converted to a Translatable Text Component with the string as the translation key.

For example, "message": "origins.gui.choose_origin.title" is equivalent to:

"message": {
"translate": "origins.gui.choose_origin.title"
}

MobEffectInstance

A MobEffectInstance defines a status effect applied to an entity. Serialized using MobEffectInstance.CODEC (1.21+).

FieldTypeDefaultDescription
idIdentifierrequiredEffect ID (e.g. minecraft:speed)
durationIntegerrequiredDuration in ticks
amplifierInteger0Effect level (0 = level I, 1 = level II, etc.)
ambientBooleanfalseWhether particles are more transparent
show_particlesBooleantrueWhether particles are visible
show_iconBooleantrueWhether the icon is displayed in the HUD
hidden_effectMobEffectInstanceoptionalNested effect instance (for effects like Bad Omen that chain another effect)

EffectEntry

An EffectEntry is a simplified status effect definition used in some power types (e.g., origins:stacking_status_effect). Unlike MobEffectInstance, it omits the duration and hidden_effect fields.

FieldTypeDefaultDescription
idIdentifierrequiredEffect ID
amplifierInteger0Effect amplifier
ambientBooleanfalseWhether particles are transparent
show_particlesBooleantrueWhether to show particles
show_iconBooleantrueWhether to show the effect icon
idIdentifierrequiredEffect ID
amplifierInteger0Effect amplifier
ambientBooleanfalseWhether the effect is ambient
show_particlesBooleantrueWhether to show particles
show_iconBooleantrueWhether to show the icon