Skip to content
Clexus edited this page Jan 21, 2025 · 8 revisions

In the item configuration file, there is a section called components, which represents the vanilla item components. Its format is too complex to be edited via commands, so you need to edit it directly in the file.

To know more about item components, see here

Example config

components:
  banner_patterns:
    layer_1:
      color: black
      pattern: base
    layer_2:
      color: yellow
      pattern: creeper
  consumable:
    animation: eat
    consume_seconds: 1.6
    has_consume_particles: true
    on_consume_effects:
      effect_1:
        type: "apply_effects"
        effects:
          effect_1:
            id: "speed"
            amplifier: 1
            duration: 100
            probability: 0.8
          effect_2:
            id: "strength"
            amplifier: 10
            duration: 100
            probability: 1
      effect_2:
        type: "clear_all_effects"
  can_place_on:
    - grass_block
    - stone
  can_break:
    - stone
  damage_resistance: "in_fire"
  death_protection:
    death_effects:
      effect_1:
        type: "apply_effects"
        effects:
          speed_boost:
            id: "speed"
            amplifier: 1
            duration: 300
            probability: 0.7
          regeneration_boost:
            id: "regeneration"
            amplifier: 2
            duration: 400
            probability: 0.5
      effect_2:
        type: "clear_all_effects"
      effect_3:
        type: "play_sound"
        sound: "entity.player.burp"
      effect_4:
        type: "remove_effects"
        effects:
          - "speed"
          - "strength"
      effect_5:
        type: "teleport_randomly"
        diameter: 20.0
  dyed_color: "255,255,255"
  enchantable: 5
  enchantment_glint_override: true
  equippable:
    slot: chest
    allowed_entites:
    - player
    asset_id: "grass_block"
    camera_overlay: "example:example"
    damage_on_hurt: true
    equip_sound: "entity.player.death"
    swappable: true
  food:
    can_always_eat: true
    nutrition: 10
    saturation: 10
  glider: true
  hide_addtional_tooltip: true
  hide_tooltip: true
  intangible_projectile: true
  max_damage: 500
  max_stack_size: 1
  rarity: epic
  tool:
    damage_per_block: 5
    default_mining_speed: 5
    rules:
    - blocks: "minecraft:stone"
      speed: 2.0
      correct_for_drops: true
    - blocks:
        - "minecraft:dirt"
        - "minecraft:gravel"
      speed: 120
      correct_for_drops: false
    - blocks: "minecraft:diamond_ore"
      speed: 3.0
      correct_for_drops: true
  tooltip_style: "example:example"
  trim:
    material: diamond
    pattern: bolt
  use_cooldown:
    seconds: 5
    cooldown_group: "example:example"
  use_remainder: "rpgitem-id"

There are only a few sections in the above configuration file that need explanation:

  • dyed_color: Use rgb format string as color

  • max_damage and max_stack_size: Item can't both have max_damage and max_stack_size(>1) components, if you set max_damage, you can't add max_stack_size or it must be 1, if you set max_stack_size, you can't add max_damage, regardless of its value.

  • effect_1,layer_1: These are section keys, you don't have to name them effect_x or layer_x, just what you want, as long as they are not duplicated.

  • Unset components:

    Some components are on item by default, like equippable on chestplate, if you want to unset it(make it not equippable), set the section like this:

    equippable:
      unset: true
    hide_tooltip:
      unset: true

    This method is applicable to all components.

Clone this wiki locally