By · Updated

Custom items with abilities, set bonuses and gems on Paper

16commands
2permissions
4files
1figure
9min read
Sheet 15 of 20 · server owners

FilesItems/default.yml · items/speed_chestplate.yml · items/phoenix_amulet.yml · sets/speedster.yml

FileItems/default.ymlFileitems/speed_chestplate.ymlCommand/item replace entityCommand/attribute @s minecraft:armor base set 5Since 1.20.5 vanilla items carry data components, so a /give command alone can put attribute modifiers on an item: extra health on a helmet, speed on boots, a bigger player while holding a stick. Data pack enchantments (1.21) can apply potion effects every tick while an item is worn. What vanilla does not have is anything that counts the pieces of a set, abilities players trigger, gems or item levels. For plain potion effects from worn or held items, the free EquipmentEffects plugin is enough. For conditions, abilities, set bonuses, gems, random rolls and item levels on Paper or Folia, use a plugin like Ignite EquipmentPro.

What you want, what to use

You wantUse
Fixed stats on an item: health, armor, speed, attack damageattribute_modifiers with /give, no plugin
Any item worn in an armor slot, like a custom hatThe equippable component (1.21.2+)
Effects when an item is eaten or drunkThe consumable component (1.21.2+)
A potion effect while an item is worn, vanilla onlyA data pack enchantment with a minecraft:tick effect
Potion effects while an item is worn or held, simple setupEquipmentEffects, free
Effects only at night, in a region, below some healthIgnite EquipmentPro conditions
A right-click ability with a cooldown or chargesIgnite EquipmentPro abilities
Bonuses for wearing 2 or 4 pieces of a setIgnite EquipmentPro sets
Gems in sockets, random stat rolls, item XP and levelsIgnite EquipmentPro

What vanilla can do now

Attribute modifiers on an item

Item NBT was replaced by data components in 1.20.5, and /give takes them in square brackets after the item id. The attribute_modifiers component is a list of modifiers, each with an attribute type, a slot, a unique id, an amount and an operation. The modifier is added to the player while the item sits in that slot and removed when it leaves.

The example from the Minecraft Wiki, a stick that makes you four times bigger while you hold it:

/give @s stick[attribute_modifiers=[{type:"minecraft:scale",slot:"hand",id:"example:grow",amount:4,operation:"add_multiplied_base"}]]

The same shape gives a helmet extra health:

/give @s diamond_helmet[attribute_modifiers=[{type:"minecraft:max_health",slot:"head",id:"myserver:helmet_hp",amount:4,operation:"add_value"}]]

The details that matter:

  • Slots are any, hand, mainhand, offhand, armor, head, chest, legs, feet, body and saddle. any means any equipment slot, not any inventory slot.
  • Operations are add_value, add_multiplied_base and add_multiplied_total.
  • The id has to be unique among modifiers of the same attribute. Two items with the same id on the same attribute do not stack.
  • Attribute names lost their generic. prefix in 1.21.2, so it is minecraft:max_health, not minecraft:generic.max_health.
  • Old commands break. Before 1.21.5 the component was wrapped as attribute_modifiers={modifiers:[...]}, and before 1.21 modifiers had a uuid and a name instead of an id. Commands copied from older posts fail for that reason.

Command/item replace entityTo put the item straight into a slot instead of the inventory, /item replace entity <player> armor.head with <item> does it, with permission level 2.

Command/attribute @s minecraft:armor base set 5/attribute is a different tool. It changes the player, not an item: /attribute @s minecraft:armor base set 5 sets a base value, and modifier add <id> <value> <operation> adds a modifier to the player directly, with no item involved.

Equippable and consumable

1.21.2 added two components that turn any item into wearable or edible gear. equippable says which slot an item goes in and how it looks there. The wiki's example gives leather leggings that look like diamond ones:

/give @s leather_leggings[equippable={slot:legs,asset_id:"minecraft:diamond"}]

consumable makes an item edible or drinkable, with on_consume_effects that run when it is used up. The consume effect types are apply_effects, remove_effects, clear_all_effects, teleport_randomly and play_sound. The wiki's example, a gold ingot that clears your effects after three seconds of eating:

/give @s gold_ingot[consumable={consume_seconds:3.0, animation:'eat', sound:'entity.generic.eat', has_consume_particles:true, on_consume_effects:[{type:'minecraft:clear_all_effects'}]}]

That covers food and potions. It does not give an effect while an item is worn.

Enchantments from a data pack

Since 1.21 enchantments are data driven. A data pack can add its own in data/<namespace>/enchantment/, with slots for the equipment slots it works in and an effects block. Two effect components are useful here: minecraft:attributes adds attribute modifiers, and minecraft:tick runs every tick, which with the apply_mob_effect entity effect gives a potion effect while the item is worn. run_function is also an entity effect, so a tick effect can call a function.

This is as close as vanilla gets to "wear this, get Speed". It is still one enchantment per behaviour, written in JSON, and nothing in it knows about other items the player wears.

Where vanilla stops

  • No sets. Each item's modifiers apply on their own. Nothing counts how many pieces of a set a player wears.
  • No abilities with a cost. There is no built-in way to say "shift-right-click to heal, 90 seconds cooldown, two charges, costs 50 coins".
  • No gems or sockets, and no command that rolls random stats onto an item you hand out.
  • No item XP or levels.
  • Every item is a long command or a JSON file, and changing it means handing out the item again.

Potion effects from worn items, for free

EquipmentEffects is a free, GPL-3.0 plugin for Spigot and Paper. It gives potion effects, and runs commands, while a player wears an item or holds it in either hand. Each item is one YAML file in Items/:

Items/default.yml
id: "DEFAULT"
name: "Default item"
must-wear: true
must-hold-mainhand: false
must-hold-offhand: false
applicable-effects:
  - "SPEED:2"
item-checks:
  all-checks: true
  display-name-check: true
  lore-check: true
  enchantment-check: true
  item-flag-check: true

Command/eea createCommand/eea giveCommand/eea reloadEffects are EFFECT:AMPLIFIER. The item checks decide how strictly the held item has to match: name, lore, enchantments, flags, or all of them. /eea create <id> saves the item in your hand as a new file, /eea give [player] <id> hands one out and /eea reload reloads, all under EquipmentEffects.admin.

Check the version first. 1.6.2-STABLE runs on Minecraft 1.8.1 to 1.19.2 with Java 8. For 1.21 there is 1.7.0-UNSTABLE, built against Spigot 1.21.5 with Java 21, and its own release calls it unstable. Folia is not on its list.

Conditions, abilities and sets with Ignite EquipmentPro

Command/eqpro listCommand/eqpro give PHOENIX_AMULETIgnite EquipmentPro is our paid successor to EquipmentEffects, for Paper and Folia 1.21 and newer on Java 21. IgniteAPI is inside the jar. On first start it writes 11 items, 3 sets and 5 gems to plugins/IgniteEquipmentPro/, so you can try it with /eqpro list and /eqpro give PHOENIX_AMULET before writing anything.

One item with passive effects, an ability, a set, a level bar and a socket.
Speedster's Stride tooltip: effects, an Emergency Heal ability, the set, level bar, milestones and a socket

An item with effects and conditions

Each item is a file in items/. This one is the bundled Speedster chestplate with a condition block added:

items/speed_chestplate.yml
id: "SPEED_CHESTPLATE"
name: "<gradient:#5ce1ff:#9b8bff>Speedster's Vest</gradient>"
tier: RARE
match-mode: HYBRID
 
allowed-slots:
  - CHESTPLATE
 
conditions:
  worlds: [ world, world_nether ]
  health-above: 30
  in-water: false
 
effects:
  - "SPEED:0"
  - type: ATTRIBUTE
    attribute: MAX_HEALTH
    amount: 3.0
    operation: ADD_NUMBER
    id: "speed_chestplate_hp"
 
set-ids: [ "speedster" ]

Potion effects use EFFECT:AMPLIFIER, with 0 for level I, and an optional duration like "JUMP_BOOST:1:60s". Besides potions and attributes there are auras, trails, particles, sounds, messages, action bars, titles, console and player commands, heals and damage.

The keys under conditions are ANDed. health-above and health-below are percent of max health. There are 18 condition types: world, biome, day or night, health, in combat, permission, holding an item, sneaking, sprinting, in water or lava, WorldGuard region, XP level, a PlaceholderAPI value, game mode, flying, on ground and blocking. For OR and NOT, write the tree form with type: OR and children.

match-mode decides how the plugin recognises the item. PDC reads a tag stored on the item, so a lookalike renamed in an anvil does not count. STRICT compares name, lore and meta. HYBRID tries the tag first and falls back to strict for older items.

Triggers

Triggers run effects when something happens, each with its own cooldown and gate condition:

triggers:
  rage-buff:
    type: ON_DAMAGE_TAKEN
    cooldown: 30s
    gate:
      health-below: 30
    effects:
      - "REGENERATION:2:5s"

There are triggers for equipping and unequipping, clicks, kills, damage dealt and taken, projectile hits, shooting a bow, breaking and placing blocks, fishing, eating, sneaking, sprinting, jumping, falling and respawning.

Abilities

An ability is something the player fires on purpose. This is the bundled Phoenix Amulet, trimmed:

items/phoenix_amulet.yml
abilities:
  rebirth:
    display-name: "Rebirth"
    activation: ON_SHIFT_RIGHT_CLICK
    cooldown: 90s
    charge-cost: 1
    gate:
      health-below: 8
    effects:
      - type: HEAL
        amount: 12.0
      - "REGENERATION:2:6s"
      - "FIRE_RESISTANCE:0:10s"
 
charge:
  max: 2
  initial: 2
  regen-interval: 15m
  regen-amount: 1
  persist: true

activation is ON_RIGHT_CLICK, ON_SHIFT_RIGHT_CLICK, ON_LEFT_CLICK or ON_INTERACT. Before it fires the plugin checks the item's permission, the gate, the cooldown, the charges and, with Vault, a money-cost. Charges refill on their own every regen-interval.

Set bonuses

A set is a file in sets/ that lists equipment ids and a bonus per piece count:

sets/speedster.yml
id: "speedster"
display-name: "<gradient:#5ce1ff:#9b8bff><bold>Speedster's Pact</bold></gradient>"
equipment-ids:
  - "SPEED_BOOTS"
  - "SPEED_LEGGINGS"
  - "SPEED_CHESTPLATE"
  - "SPEED_HELMET"
tier-bonuses:
  2:
    description: "Two pieces - the wind takes notice."
    effects:
      - "SPEED:0"
  4:
    description: "Full set."
    effects:
      - "JUMP_BOOST:1"
      - { type: AURA, particle: CLOUD, radius: 1.0, points: 8 }
    console-commands:
      - "say {player} has assembled the full Speedster set!"

Placeholder%eqpro_set_pieces_speedster%Bonuses stack, so four pieces give both the 2 and the 4 piece bonus. %eqpro_set_pieces_speedster% shows how many pieces a player has on.

Gems and sockets

An item declares its sockets, and a gem in gems/ carries effects:

sockets:
  primary:
    minimum-gem-tier: RARE
  secondary:
    minimum-gem-tier: COMMON

Command/eqpro socket PHOENIX_AMULET fire_gemPermissionigniteequipmentpro.editHold the item and run /eqpro socket PHOENIX_AMULET fire_gem. The gem is stored on that one item, so two amulets can carry different gems, and its effects are added on top of the item's own. minimum-gem-tier shows in the tooltip, but the command does not enforce it. Socketing is a command under igniteequipmentpro.edit and does not take a gem item from the inventory, so to let players do it, run the command from a menu or shop plugin.

Random rolls

A roll-table gives each copy of an item its own stats:

roll-table:
  rolls: 2
  pool:
    - { weight: 50, label: "Speed I", effect: "SPEED:0" }
    - { weight: 30, label: "Jump II", effect: "JUMP_BOOST:1" }
    - { weight: 20, label: "+4 HP", effect: { type: ATTRIBUTE, attribute: MAX_HEALTH, amount: 4.0 } }

Command/eqpro give-randomCommand/eqpro give/eqpro give-random <id> [player] picks rolls entries by weight and stores them on the item. A plain /eqpro give gives the item without rolls.

Item XP and levels

xp-rewards gives XP per kill, mob kill, damage dealt, block broken or fish caught. XP is kept per player and per equipment id, the level is floor(sqrt(xp / 100)), and level-rewards adds effects that unlock at a level plus a one-off title or command when the player reaches it. %eqpro_level_<id>% and %eqpro_xp_<id>% show both.

Commands

CommandWhat it does
/eqpro new <id>New equipment from the held item, opens the editor
/eqpro give <id> [player]Give an item
/eqpro give-random <id> [player]Give an item with rolled stats
/eqpro create <id>Tag the held item as an existing equipment id
/eqpro socket <equipment-id> <gem-id>Put a gem in the held item
/eqpro editor [id]In-game editor, writes back to the YAML and to audit.log
/eqpro debug [player]Shows equipped ids and which ones pass their conditions
/eqpro reloadReload items, sets and gems

Permissionigniteequipmentpro.adminAll nodes sit under igniteequipmentpro.admin and default to op. Progress is stored in YAML, SQLite, MySQL or MongoDB.

The full feature list, the gallery and the price, 24.99 EUR paid once, are on the product page.

Troubleshooting

SymptomCheck
/give with attribute_modifiers fails to parseThe command uses the pre-1.21.5 {modifiers:[...]} form or a uuid, or a generic. attribute name
Two items with the same bonus do not stackTheir modifiers share an id on the same attribute
An EquipmentEffects item gives nothing on 1.21You run 1.6.2-STABLE, which stops at 1.19.2
An EquipmentPro item gives nothing/eqpro debug <player>. Listed under equipped but not under condition pass means a condition fails
A copied vanilla item is not recognisedIt has no tag. Give it with /eqpro give, or tag it with /eqpro create <id>
A low health condition never fireshealth-below is percent of max health, not health points

Where to go next

Written from

  1. Minecraft Wiki: Data component format (attribute_modifiers, equippable, consumable)
  2. Minecraft Wiki: Java Edition 1.20.5, items move to data components
  3. Minecraft Wiki: Java Edition 1.21, data-driven enchantments and modifier ids
  4. Minecraft Wiki: Java Edition 1.21.2, equippable and consumable
  5. Minecraft Wiki: Java Edition 1.21.5, attribute_modifiers list form
  6. Minecraft Wiki: Attribute
  7. Minecraft Wiki: /attribute command
  8. Minecraft Wiki: /item command
  9. Minecraft Wiki: Enchantment definition
  10. EquipmentEffects page and source
  11. Ignite EquipmentPro product page and bundled configs