Skip to main content

Enchantment (Entity Condition Type)

Compares the level of an enchantment on the entity's equipment with a number.

Type ID: apoli:enchantment

Fields

FieldTypeDefaultDescription
enchantmentIdentifierrequiredThe ID of the enchantment.
use_modificationsBooleantrueWhether to count levels changed by apoli:modify_enchantment_level. With true, an empty slot the enchantment applies to, such as an empty main hand for Sharpness, can count too. With false, only the levels stored on the items are read.
calculationString"sum"Which number to compare: the sum of this enchantment's levels across all of the entity's equipment, or the max level on any single piece.
comparisonComparisonrequiredHow the enchantment level is compared with compare_to.
compare_toIntegerrequiredThe number the level is compared with.

Examples

"condition": {
    "type": "apoli:enchantment",
    "enchantment": "minecraft:protection",
    "calculation": "sum",
    "comparison": ">=",
    "compare_to": 16
}

This checks whether the entity is wearing a full set of Protection IV armor, or better where mods allow it.

"condition": {
    "type": "apoli:enchantment",
    "enchantment": "minecraft:fortune",
    "use_modifications": false,
    "calculation": "max",
    "comparison": ">=",
    "compare_to": 1
}

This checks for real Fortune on the entity's equipment, ignoring any levels that powers grant.