Skip to content

Attribute Definitions

Attribute files are stored under attributes/*.yml. Each file usually defines one attribute, including how the value is identified, clamped, displayed, parsed, and used by combat or other modules.

Important fields

FieldDescription
idUnique attribute id used by other modules.
display_nameDisplay name and lore matching key. Defaults to id.
value_kindValue style, such as FLAT, PERCENT, CHANCE, REGEN, RESOURCE, or DERIVED.
target_typeTarget system, such as GENERIC, DAMAGE, RESOURCE, or VANILLA.
target_idDamage type id, resource id, or vanilla attribute id depending on target_type.
default_valueDefault base value.
min_value / max_valueOptional clamps.
allow_negativeWhether negative values are allowed.
priorityLore parsing priority. Higher values match earlier.
lore_format_idLinked lore format definition.
lore_pattern / lore_patternsRegex patterns used for lore parsing.
attribute_powerWeight used when calculating total power.

Value kinds

ValueDescription
FLATFixed additive value.
PERCENTPercentage value. Lore parsing handles % suffixes.
CHANCEChance-like percentage value.
REGENRegeneration rate.
RESOURCEResource capacity contribution.
DERIVEDDerived attribute calculated from other values.

Target types

ValueDescription
GENERICGeneral-purpose attribute.
DAMAGEParticipates in a damage_types/*.yml damage pipeline.
RESOURCEAffects resource maximums or recovery.
VANILLASyncs to a vanilla Minecraft/Bukkit attribute.

Ranged random values

Current Attribute parsing supports ranged contributions. A range keeps the minimum, maximum, and resolved actual value in the snapshot contribution, which is useful for random attack rolls or random percentage bonuses.

Example:

yaml
ea_attributes:
  physical_attack: "10-20"
  physical_crit_rate: "5%-12%"

Guidelines:

  • Numeric ranges are suitable for attack, defense, and resource-capacity attributes.
  • Percentage ranges are suitable for PERCENT and CHANCE attributes. Keep one consistent scale across the system; do not mix 0.15 and 15 for the same meaning.
  • Debug output should inspect the min, max, and actual resolved value when a contribution comes from a range.
  • New equipment systems should still prefer PDC payloads over lore-only parsing.

Lore parsing

lore_pattern and lore_patterns can use these variables:

VariableExpands to
%Key% / %key%Escaped display_name.
%Value% / %value%Numeric capture group.

Lore parsing is mainly for compatibility with old or external items. For new Emaki item flows, prefer explicit PDC payloads from EmakiItem, Forge, Strengthen, or Gem.