Skip to main content

Enchantment (Item Condition Type)

Compares the level of an enchantment on the item, or the number of enchantments it has, with a number.

Type ID: apoli:enchantment

Fields

FieldTypeDefaultDescription
enchantmentIdentifieroptionalThe enchantment whose level is compared. Without it, the number of enchantments on the stack is compared instead.
use_modificationsBooleantrueWhether to count levels changed by apoli:modify_enchantment_level. They apply when the item is worn or held by an entity with that power, or when the check runs for an entity with that power, for example inside apoli:equipped_item or apoli:inventory. With false, only the enchantments stored on the item are read.
comparisonComparison">"How the level, or the number of enchantments, is compared with compare_to.
compare_toInteger0The number it is compared with.

Examples

"item_condition": {
    "type": "apoli:enchantment",
    "enchantment": "minecraft:fortune",
    "comparison": "==",
    "compare_to": 3
}

This checks whether the item has Fortune III.

"item_condition": {
    "type": "apoli:enchantment",
    "comparison": ">=",
    "compare_to": 3
}

This checks whether the item has 3 or more enchantments.

"item_condition": {
    "type": "apoli:enchantment"
}

This checks whether the item has any enchantment at all.