Skip to content
Clexus edited this page May 31, 2025 · 3 revisions

配置文件中有一个叫做 components 的部分, 代表的就是原版的物品组件. 因为通过命令编辑太过复杂,所以请直接在文件中编辑.

注意: 要在服务器运行的时候编辑文件, 你需要在 config.yml 中将 fs_lock 设置为 false

有关物品组件的更多信息见

样例配置(也是所有支持的组件)

components:
  banner_patterns:
    layer_1:
      color: black
      pattern: base
    layer_2:
      color: yellow
      pattern: creeper
  blocks_attacks:
    block_delay_seconds: 0
    block_sound: "entity.player.death"
    bypassed_by: "#is_explosion"
    damage_reductions:
      reduction_1:
        base: 1
        factor: 1
        horizontal_blocking_angle: 30
        type:
        - "#is_fall"
        - "on_fire"
    disable_cooldown_scale: 10
    disabled_sound: "entity.player.death"
    item_damage:
      base: 10
      factor: 10
      threshold: 10
  break_sound: "entity.player.death"
  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
  intangible_projectile: true
  max_damage: 500
  max_stack_size: 1
  potion_duration_scale: 10.5
  profile: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTRkODE2YTQ3NWIzZjMxM2I2MjBkNjViZjkzNTg5MzFiNDZhZjljOGY0ZTdjOWFlNjQ3MDg4ODBiZWE2YmUifX19"
  provides_banner_patterns: "globe"
  provides_trim_material: "gold"
  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_display:
    hide_tooltip: true
    hidden_components:
    - trim
    - rarity
  tooltip_style: "example:example"
  trim:
    material: diamond
    pattern: bolt
  use_cooldown:
    seconds: 5
    cooldown_group: "example:example"
  use_remainder: "rpgitem-id"
  weapon:
    disable_blocking_for_seconds: 10
    item_damage_per_attack: 10

只有几个地方需要注意:

  • profile: 可以使用Base64码或者玩家名称。比如profile: "Steve"或者profile: "ey...."

  • dyed_color: 用RGB颜色格式

  • max_damagemax_stack_size: 物品不能同时拥有 max_damagemax_stack_size 组件, 如果你设置了 max_damage, 你就不能设置 max_stack_size, 或者设置其值为 1, 如果你设置了 max_stack_size, 你就不能设置 max_damage, 无论其值为何.

  • effect_1,layer_1: 这些都是ID, 你不需要让它们叫 effect_x 或者 layer_x, 想叫啥都行, 只要不重复就行.

  • 删除组件: 有些组件在物品上默认存在, 比如盔甲上就有 equippable 组件, 如果你想删除这些组件,你可以像下面这样设置:

    equippable:
      unset: true
    hide_tooltip:
      unset: true

    该方法对所有组件都有效.

Clone this wiki locally