Creating Custom Items - ochotonida/artifacts GitHub Wiki

Starting from Minecraft 1.21, it is possible to apply the abilities of artifacts on other items using item components. The item must be equipped in an armor slot or in a curio/trinket/accessory slot in order for the abilities to apply. Items can be made equipable in a slot by giving the item the corresponding item tag, more information can be found on the Curios/Trinkets/Accessories wikis. The item components available in the latest version of Artifacts are listed below (all components use the artifacts: namespace).

Component fields accepting a boolean, integer, double or tool tier will generally accept the name of an item config value of the same type. For example, the following command summons Iron Boots that replenish the player's hunger using the rooted_boots.hungerReplenishingDuration value set in the item config.

/give @a iron_boots[artifacts:replenish_hunger_on_grass={duration:"rooted_boots.hungerReplenishingDuration"}]

Some components have an optional enabled field, which, when set to false, disables the component entirely. These are used in combination with an item's enabled config option, to remove the need to restart the game after changing the config.

Utility Components

abilities

Unused as of version 13.0.0

toggle_key

When this component is present, the item can be toggled on and off using the specified toggle key. Must be one of: charm_of_shrinking, charm_of_sinking, night_vision_goggles, scarf_of_invisibility, universal_attractor

disabled_by_toggle

When this component is present, all components in the abilities section are ignored. This component is automatically added and removed when the toggle key for the item is pressed. This component has no fields.

equip_sound

The id of the sound event that should play when the item is right-click equipped. This component only works on wearable items added by Artifacts.

ability_lore

Uses the same format as the vanilla minecraft:item_lore component. The tooltip from this component is ordered before ability tooltips instead of after.

piglin_loved

Piglins are neutral towards players wearing an item with this component. This component has no fields. The vanilla minecraft:piglin_loved item tag may also be of interest.

hurt_sound

When this component is present, an additional sound will play when an entity wearing the item takes damage.

  • sound: The id of the sound event that should play
  • enabled: (optional) Whether this component is enabled

reduced_night_vision

When an item with this component is worn, the brightness of any night vision effect will be reduced by this factor when the effect has less than 12 seconds remaining. Accepts a number between 0 and 1.

hide_when_invisible

Items with this component will hide their model when the entity wearing it is invisible. This component only works on wearable items added by Artifacts.

  • enabled: (optional) Whether this component is enabled

Ability Components

post_damage_cooldown

When a player wearing the item takes damage, the item goes on cooldown. Most abilities will stop functioning when an item is on cooldown.

  • cooldown: The amount of time the item goes on cooldown for, in seconds
  • tag: (optional) A damage type tag to filter on

post_damage_effects

A list of mob effects that should be applied when an entity wearing the item takes damage. Objects in the list have the following fields:

  • effect: An object with the following fields:
    • id: The id of the mob effect
    • level: (default = 1) The level of the mob effect
    • duration: (default = 10) The duration of the mob effect
    • spawn_particles: (default = true) Whether the effect should emit particles
    • show_icon: (default = false) Whether the icon of the effect should be visible in the HUD
    • condition: (default = always) A condition that must be true for the entity wearing the item. Must be one of always, never, above_water, in_water, on_grass, while_sneaking, while_sprinting.
  • chance: (default = 1) The probability that the effect is applied to the entity when it takes damage
  • tag: (optional) A damage type tag to filter on

post_eating_effects

A list of mob effects that should be applied when a player wearing the item finishes eating food. The objects in the list should follow the same format as the effect field from post_damage_effects. The duration of the effect is multiplied with the amount of food points restored.

damage_absorption

Causes melee attacks from entities wearing the item to absorb a portion of the damage dealt.

  • absorption_ratio: The proportion of damage dealt that is absorbed
  • absorption_chance: The chance that damage is absorbed when attacking an entity
  • max_damage_absorbed: The maximum amount of damage that can be absorbed in a single hit

attack_effects

A list of effects to inflict on entities attacked by the entity wearing the item. The objects in the list have the following format:

  • effect: The mob effect that should be applied. Uses the same format as the effect field from post_damage effects.
  • chance: (default = 1) The probability that the effect is inflicted after an attack
  • cooldown: (default = 0) The amount of time the item goes on cooldown for after successfully applying an effect

attribute_modifiers

A list of attribute modifiers that should be applied to entities wearing this item. Objects in the list use the following format:

  • attribute: An attribute id
  • amount: The attribute modifier amount
  • operation: The operation of the attribute modifier. Can be either add_value, add_multiplied_base or add_multiplied_total.
  • id: An identifier for this attribute modifier. Note that this identifier must be unique such that it does not conflict with other attribute modifiers.
  • ignore_cooldown: (default = true) Whether this attribute modifier should still be active when the item is on cooldown

damage_immunity

Makes the wearer immune to a specific type of damage

  • tag: A damage type tag to filter on
  • condition: (default = always) A condition that should be true when the entity takes damage. Must be one of always, never, above_water, in_water, on_grass, while_sneaking, while_sprinting.

double_jump

Allows players to double jump.

  • fall_damage_multiplier: (default = 0) How much fall damage players take when double jumping after falling
  • sprint_jump_horizontal_velocity: (default = 0) The amount of extra horizontal velocity that is applied when double jumping while sprinting
  • sprint_jump_vertical_velocity: (default = 0) The amount of extra vertical velocity that is applied when double jumping while sprinting
  • enabled: (default = true) Whether this component is enabled

ender_pearl_hunger_cost

Causes ender pearls not to be consumed, but cost hunger instead.

  • cost: The amount of hunger points it costs to throw an ender pearl
  • cooldown: (default = 0) The duration ender pearls go on cooldown for, in addition to the default 1 second cooldown
  • enabled: (default = true) Whether this component is enabled

post_eating_plant_growth

Causes a bone meal effect to be applied when the player eats an item while standing on grass or moss.

  • enabled: (default = true) Whether this component is enabled

enchantment_level_modifiers

Increases the enchantment levels of specific enchantments for the entity. Currently supported enchantments are Fortune, Looting, Luck of the Sea and Lure. Objects in the list use the following format:

  • enchantment: An enchantment id
  • level (Default: 1): The amount to increase the enchantment level by.

mob_effects

A list of mob effects to apply to entities wearing the item. Objects in this list use the same format as the effect field from post_damage_effects

ender_pearl_damage_immunity

Nullifies the damage caused by ender pearls.

  • enabled: (default = true) Whether this component is enabled.

cure_effects

Reduces the duration of effects in the artifacts:antidote_vessel_cancellable tag

  • duration: The duration in seconds that negative effects are reduced to
  • enabled: (default = true) Whether this component is enabled

replenish_hunger_on_grass

Replenishes hunger when the entity is standing on grass

  • duration: The duration in seconds it takes to regenerate a single food point
  • enabled: (default = true) Whether this component is enabled

creeper_repellent

Makes nearby creepers run away from the entity.

  • enabled: (default = true) Whether this component is enabled

phantom_repellent

Makes the item hiss at attacking phantoms when worn.

  • enabled: (default = true) Whether this component is enabled

sinking

Causes the entities movement to be unaffected by fluids.

  • enabled: (default = true) Whether this component is enabled

auto_smelt

Smelts ores mined by the wearer

  • enabled: (default = true) Whether this component is enabled

fluid_collision

Allows the wearer to stand on fluids tag: (optional) A fluid tag to filter on condition: A condition that must be true for the entity. Must be one of: always, never, while_sneaking, while_sprinting

swim_in_air

Allows the wearer to swim in the air.

  • flight_duration: The duration in seconds the player can swim in air before needing to recharge
  • recharge_duration: The amount of time it takes to recharge this ability
  • cooldown: The amount of time the item goes on cooldown for when stopping flight mid-air

death_protection_teleport

Teleports the entity to a random location if the entity would otherwise die.

  • chance: (default = 1) The chance the entity is teleported on death
  • health_restored (default = 10): The amount of health points to restore when the ability activates
  • cooldown (default = 0): The amount of time the item goes on cooldown for when the ability activates
  • consume: (default = true) Wether the item is consumed when the ability activates

retaliation_effects

The effects that should be applied on attacking entities

  • thorns: (optional) When present, the attacking entity is damaged
    • chance: The probability an attacking entity is damaged
    • cooldown: (default = 0) The amount of time in seconds the item goes on cooldown for after successfully damaging an attacker
    • min_damage: The minimum amount of damage dealt
    • max_damage: The maximum amount of damage dealt
  • fire: (optional) When present, the attacking entity is set on fire
    • chance: The probability that the attacking entity is set on fire
    • cooldown: (default = 0) The amount of time in seconds the item goes on cooldown for after successfully setting an attacker on fire
    • duration: How long the attacking entity is set on fire for
    • grant_fire_resistance: (default = true) Whether a fire resistance buff should be applied to the entity wearing the item when an attacker is set on fire
  • lightning: (optional) When present, attacking entities that are visible to the sky are struck by lightning
    • chance: The probability that the attacking entity is struck by lightning
    • cooldown: (default = 0) The amount of time in seconds the item goes on cooldown for after successfully striking an attacker with lightning

tool_tier_upgrade

Upgrades the player's base tool tier.

  • tier: The tier the player's base mining level is upgraded to. Can be one of wood, stone, iron, diamond or netherite.

walk_on_powder_snow

Allows the entity to walk on powder snow.

  • enabled: (default = true) Whether this component is enabled