English
Conditions
Condition files live under conditions/*.yml. A condition file covers the fields of a condition group, the entry types you can use, and the variables available in condition expressions. They define PDC read rules that decide whether an item's attribute payload activates, and you can reference them for equipment restrictions, recipe restrictions, skill restrictions, and cross-module checks. Note that some bundled examples ship with enabled: false and must be enabled deliberately
Condition group fields
| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Whether this condition group is loaded. Disabled files are skipped |
source_id | string | — | Source id this rule applies to. Required when enabled |
condition.type | string | all_of | How entries are combined |
condition.required_count | integer | 1 | Number of entries that must pass when condition.type is at_least or exactly. An unconfigured value resolves to 1 at evaluation time |
condition.invalid_as_failure | boolean | true | Whether a malformed or unevaluable condition counts as failure |
condition.entries | list | [] | Condition entries |
condition.type values
| Value | Description |
|---|---|
all_of | Every entry must pass |
any_of | At least one entry must pass |
at_least | At least required_count entries must pass |
exactly | Exactly required_count entries must pass |
none_of | No entry may pass |
Entry types
| Type | Description |
|---|---|
pdc_meta | Check a value in the payload's meta map |
lore_regex | Match item lore with a regular expression |
pdc_attribute | Check an attribute value inside the payload |
source_id | Check the payload's source id |
pdc_meta and pdc_attribute entries require a key. lore_regex entries require a pattern, which must be a valid regular expression. A checks field is not supported and makes the file fail validation
pdc_meta entry
| Field | Description |
|---|---|
type | pdc_meta |
key | Meta key to read |
condition | Comparison expression |
lore_regex entry
| Field | Description |
|---|---|
type | lore_regex |
pattern | Regular expression; matched case-insensitively with Unicode support |
require_match | Whether a match is required |
condition | Comparison expression, may use capture groups |
pdc_attribute entry
| Field | Description |
|---|---|
type | pdc_attribute |
key | Attribute id |
condition | Comparison expression |
source_id entry
| Field | Description |
|---|---|
type | source_id |
condition | Comparison expression checking the payload's source id |
Built-in expression variables
In the condition field you can use these variables:
| Variable | Description |
|---|---|
%value% | Current field value (the pdc_meta key value, or the pdc_attribute attribute value). lore_regex is the exception: there it receives the whole matched lore line, not a capture group, so a numeric comparison such as %value% <= %player_level% does not work. Use $1 instead |
$0, $1, $2, ... | Regex capture groups, available in lore_regex entries. $0 is the whole match, $1 onward are the capture groups. Use these to read numbers under lore_regex |
%source_meta_<key>% | A value from the payload's meta map |
%source_attribute_<key>% | A value from the payload's attributes map |
%source_id% | The payload's source id |
%player_name% | Player name |
%player_level% | Player experience level |
NOTE
When PlaceholderAPI is installed, its placeholders can also be used in condition expressions
Example: PDC meta condition
yaml
enabled: true
source_id: forge
condition:
type: all_of
invalid_as_failure: true
entries:
- type: pdc_meta
key: required_level
condition: '%value% <= %player_level%'Example: attribute value condition
yaml
enabled: true
source_id: equipment_check
condition:
type: all_of
entries:
- type: pdc_attribute
key: physical_attack
condition: '%value% >= 50'Example: source match condition
yaml
enabled: true
source_id: strengthen
condition:
type: all_of
entries:
- type: source_id
condition: '%source_id% == "strengthen"'Example: lore regex condition
yaml
enabled: true
source_id: legacy_weapon
condition:
type: any_of
invalid_as_failure: true
entries:
- type: lore_regex
pattern: '.*Weapon Level: (\d+).*'
require_match: true
condition: '$1 >= 20'Example: at least N conditions
yaml
enabled: true
source_id: multi_check
condition:
type: at_least
required_count: 2
entries:
- type: pdc_meta
key: enchant_level
condition: '%value% >= 3'
- type: pdc_meta
key: quality
condition: '%value% == "epic"'
- type: pdc_attribute
key: physical_attack
condition: '%value% >= 100'Bundled condition files
| File | source_id | Description |
|---|---|---|
strengthen.yml | strengthen | Strengthen source |
forge.yml | forge | Forge source; checks required_level <= player_level |
emakiitem.yml | emakiitem | Item source; checks condition_expressions |
default_bind.yml | gem_bind | Soul-bind check on bound_player == player_name. Disabled by default |
default_equipment_level.yml | gem_equipment_level | Equipment level check via lore_regex. Disabled by default |
After you edit condition files, run /ea lint first so schema problems (a missing source_id, an unsupported checks field, an invalid condition type, a missing key / pattern, a broken regex) surface before you reload