Skip to content

Syntax Components

xef5000 edited this page Jul 13, 2025 · 3 revisions

Components parameter

type: optional

The components block is the modern, vanilla-compliant method for defining an item's properties, introduced in Minecraft 1.20.5. It is the recommended way to define item attributes on all supported modern servers.

Using this block gives you direct access to Minecraft's powerful item component system, allowing for much greater control than legacy parameters.

Relationship to Legacy Parameters

Priority: Properties defined inside the components block will always take priority over their legacy, top-level counterparts (like name, lore, custom-model-data, etc.).

This allows for creating fallback configurations for older servers while using the modern system on newer ones.

Example of Priority

item:
  material: diamond
  # This legacy name will be IGNORED on a 1.20.5+ server because a component name exists.
  name: "&cLegacy Name"
  components:
    # This modern name will BE USED because it is inside the components block.
    minecraft:custom_name: {"text":"Modern Name","color":"gold","italic":false}

Values

The components parameter is a map where the key is the Vanilla Component ID and the value is the data for that component. A full list of all possible Component IDs and their data formats can be found on the Official Minecraft Wiki. The data for a component value can be one of two types:

  1. JSON Used for complex data like text with colors, fonts, and events. The value must be valid JSON.
minecraft:custom_name: {"text":"JSON Formatted Name","color":"red"}
  1. YAML Since YAML is a superset of JSON, it can be used to represent JSON
minecraft:custom_name:
  text: YAML Formatted Name
  color: red

Example usage

item:
  material: NETHERITE_SWORD
  components:
    minecraft:custom_name: {"text":"Blade of the End","color":"#5500AA","italic":false}
    minecraft:lore:
      - {"text":"A weapon of immense power.","color":"dark_purple","italic":false}
      - {"text":"Handle with care.","color":"gray"}
    minecraft:custom_model_data:
      floats:
        - 1337
    minecraft:unbreakable: {}
    minecraft:max_stack_size: 1
    minecraft:enchantment_glint_override: true
Clone this wiki locally