-
Notifications
You must be signed in to change notification settings - Fork 63
Creating Custom Items
Starting from Minecraft 1.20.6, Artifacts allows the creation of custom items through the artifacts:abilities
item component. The component is a list of entries, each containing a type
field, which specifies the ability type to use, and optionally some additional fields depending on the ability type used. For example, the following command spawns an Iron Helmet that allows the player to double jump, and applies 5 seconds of haste every time the player takes damage:
/give @a iron_helmet[
artifacts:abilities=[
{type:"artifacts:double_jump"},
{type:"artifacts:apply_mob_effect_after_damage", duration: 5, mob_effect:haste}
]
]
The abilities
component can be applied to armor items, or items that can be equipped in a curio/trinket slot. To make an item equippable in a slot, the corresponding item tag must be added to it. More information can be found on the Curios Wiki or Trinkets Wiki.
The latest version of Artifacts has the following ability types:
Applies a cooldown to the item when the entity wearing it takes damage. (Note that not all abilities will stop functioning when the 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
Applies a mob effect to the entity after it takes damage.
-
mob_effect
: A mob effect id -
level
(Default: 1): The level of the mob effect -
duration
: The duration of the mob effect, in seconds -
tag
(Optional): A damage type tag to filter on
Applies a mob effect to the entity after it eats an item, the duration of which depends on the amount of food points that were restored.
-
mob_effect
: A mob effect id -
level
(Default: 1): The level of the mob effect -
duration
: The duration the mob effect lasts in seconds, per food point consumed
Causes melee attacks 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
Applies a mob effect to entities attacked by the entity with this ability. Only affects melee attacks.
-
mob_effect
: A mob effect id -
level
(Default: 1): The level of the mob effect -
duration
: The duration the mob effect lasts in seconds -
cooldown
(Default: 0): The duration in seconds the item goes on cooldown for after successfully inflicting the effect -
chance
(Default: 1): The probability that the effect is inflicted after an attack
Attracts nearby items to the entity
Applies an attribute modifier to the entity with this ability.
-
attribute
: An attribute id -
amount
: The attribute modifier amount -
operation
: The operation of the attribute modifier. Can be eitheradd_value
,add_multiplied_base
oradd_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
Adds a custom tooltip to the item.
-
tooltip
: A text component, can be a string
Makes the player immune to a specific type of damage
-
tag
: A damage type tag to filter on
Allows players to double jump.
-
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
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
Causes a bone meal effect to be applied when the player eats an item while standing on grass.
Increases current the enchantment level of specific enchantments for the entity with this ability. Currently supported enchantments are Fortune, Looting, Luck of the Sea and Lure.
-
enchantment
: An enchantment id -
level
(Default: 1): The amount to increase the enchantment level by.
Applies a water breathing effect with a limited duration when the player is not submerged.
-
duration
: The duration the water breathing effect lasts for
Makes piglins neutral, similar to gold armor.
Applies a permanent mob effect to the entity.
-
mob_effect
: A mob effect id -
level
(Default: 1): The level of the mob effect
Plays an additional sound effect when the entity gets hurt.
-
sound
: A sound event id
Applies a night vision effect to the player.
-
strength
(Default: 1): Determines how strong the night vision effect is.
Nullifies the damage from ender pearls.
Reduces the duration of effects in the artifacts:antidote_vessel_cancellable
tag
-
duration
: The duration in seconds that negative effects are reduced to
Replenishes hunger when the entity is standint on grass
-
duration
: The duration in seconds it takes to regenerate a single food point
Makes nearby creepers run away from the entity.
Lights attacking entities on fire with some probability.
-
chance
: The chance an attacking entity is lit on fire -
cooldown
(Default: 0): The amount of time in seconds the item goes on cooldown for after successfully lighting an entity on fire -
duration
: The duration attacking entities are set on fire for -
grant_fire_resistance
(Default: true): Whether the ability grants a temporary fire resistance effect after lighting an entity on fire
Causes the entities movement to be unaffected by fluids.
Smelts ores mined by the entity.
Allows the wearer to stand on fluids while sneaking.
Allows the wearer to walk on fluids while sprinting.
Strikes attacking entities with lightning.
-
chance
: The chance an attacking entity is struck with lightning -
cooldown
(Default: 0): The amount of time in seconds the item goes on cooldown for after succesfully striking an entity with lightning
Allows the player to swim in 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
Teleports the entity to a random location if the entity would otherwise die.
-
teleportation_chance
: The chance the ability activates when the entity dies -
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
: Wether the item is consumed when the ability activates
Damages attacking entities.
-
chance
: The chance 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
Upgrades the players base tool tier.
-
tier
: The tier the player's base mining level is upgraded to. Can be one ofwood
,stone
,iron
,diamond
ornetherite
.
Allows the entity to walk on powdered snow.