Skip to main content

Item Action Types

Item actions perform operations on an item stack.

origins:add_enchantment

Adds enchantments to the item.

FieldTypeDefaultDescription
enchantmentEnchantment->int MaprequiredEnchantment ID to add
overrideBooleanfalseWhether to force override existing enchantments
Example
"item_action": {
"type": "origins:add_enchantment",
"enchantment": {
"minecraft:sharpness": 5
}
}

This example will add the Sharpness enchantment with a level of 5 to the item.

origins:consume

Consumes one or more items from the stack.

FieldTypeDefaultDescription
amountInteger1Amount to consume
Example
"item_action": {
"type": "origins:consume",
"amount": 1
}

This example will "consume" (remove) 1 item from the item stack.

origins:cooldown

Unstable

This action is currently unstable and may not work as intended. Please report if you encounter any issues with it.

Applies an item cooldown to a player holding the item stack.

FieldTypeDefaultDescription
ticksIntegerrequiredCooldown duration in ticks

origins:damage

Damages the item stack.

FieldTypeDefaultDescription
amountInteger1Damage amount
ignore_unbreakingBooleanfalseWhether to ignore the Unbreaking enchantment

origins:holder_action

Executes an entity action on the item's holder.

FieldTypeDefaultDescription
actionEntity ActionrequiredAction to execute

origins:merge_component

Merges a data component into the item stack.

FieldTypeDefaultDescription
componentNBTrequiredData component to merge

origins:modify

Modifies the item stack.

FieldTypeDefaultDescription
modifier[Modifier]requiredValue modifier
item_actionItem ActionoptionalNested action
Example
"item_action": {
"type": "origins:modify",
"modifier": "example:stuff"
}

This example will apply the example:stuff (data/example/item_modifiers/stuff.json) item modifier to the item stack.

origins:remove_enchantment

Removes an enchantment from the item.

FieldTypeDefaultDescription
enchantmentIdentifieroptionalEnchantment ID to remove (all if not specified)
Example
"item_action": {
"type": "origins:remove_enchantment",
"enchantment": "minecraft:mending",
"reset_repair_cost": true
}

This example will remove the Mending enchantment from the item whilst resetting its 'repair cost'.