Skip to content

Conditions

Attribute condition files are stored under conditions/*.yml. They define PDC read rules that decide whether an item's attribute payload is activated, and can be referenced for equipment restrictions and cross-module checks. Some bundled examples ship with enabled: false and must be enabled deliberately.

Condition group fields

FieldTypeDefaultDescription
enabledbooleantrueWhether this condition group is loaded. Disabled files are skipped.
source_idstringSource id this rule applies to. Required when enabled.
condition.typestringall_ofHow entries are combined.
condition.required_countintegerNumber of entries that must pass when condition.type is at_least or exactly.
condition.invalid_as_failurebooleantrueWhether a malformed or unevaluable condition counts as failure.
condition.entrieslist[]Condition entries.

condition.type values

ValueDescription
all_ofEvery entry must pass.
any_ofAt least one entry must pass.
at_leastAt least required_count entries must pass.
exactlyExactly required_count entries must pass.
none_ofNo entry may pass.

Entry types

TypeDescription
pdc_metaCheck a value in the payload's meta map.
lore_regexMatch item lore with a regular expression.
pdc_attributeCheck an attribute value inside the payload.
source_idCheck 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

FieldDescription
typepdc_meta
keyMeta key to read.
conditionComparison expression.

lore_regex entry

FieldDescription
typelore_regex
patternRegular expression; matched case-insensitively with Unicode support.
require_matchWhether a match is required.
conditionComparison expression, may use capture groups.

pdc_attribute entry

FieldDescription
typepdc_attribute
keyAttribute id.
conditionComparison expression.

source_id entry

FieldDescription
typesource_id
conditionComparison expression checking the payload's source id.

Built-in expression variables

The condition field supports these variables:

VariableDescription
%value%Current field value (the pdc_meta key value, or the pdc_attribute attribute value).
$0, $1, $2, ...Regex capture groups, available in lore_regex entries.
%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.

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

Filesource_idDescription
strengthen.ymlstrengthenStrengthen source.
forge.ymlforgeForge source; checks required_level <= player_level.
emakiitem.ymlemakiitemItem source; checks condition_expressions.
default_bind.ymlgem_bindSoul-bind check on bound_player == player_name. Disabled by default.
default_equipment_level.ymlgem_equipment_levelEquipment level check via lore_regex. Disabled by default.

Run /ea lint after editing condition files to surface schema problems before reloading.