Skip to main content

Get 25% OFF on your first order with BisectHosting using code "DAQEM"!

Has Enchantment

The arc:has_enchantment condition type checks if the item involved in the action has a specific enchantment.

Parameters

ParameterTypeRequiredDefaultDescription
enchantmentArcEnchantmentRequired-The enchantment to check.
comparisonComparisonTypeOptional==Level comparison type.

Example

The following example checks if the item used has Sharpness V.

data/my_datapack/arc/sharpness_check.json
{
"holder": {
"type": "arc:player",
"id": "arc:player"
},
"type": "arc:on_hurt_entity",
"conditions": [
{
"type": "arc:has_enchantment",
"enchantment": {
"id": "minecraft:sharpness",
"level": 5
},
"comparison": "=="
}
],
"rewards": []
}

Compatible Action Types