Skip to main content

MxtPhysiques: Physiques

A physique is the element-independent half of the same identity: it grants vanilla attributes and abilities, scales the damage its holder deals and takes, and excludes other physiques through its mutual-exclusion tags. The element-bound half is MxtSpiritRoots. On a grant, holder_condition and exclusive_tags are judged against the current entity.

Methods​

MethodParametersReturn valueDescription
list(entity)EntityList<String>Every physique the entity holds, sorted by ID (with allow_stacking the same ID can appear more than once).
active(entity)EntityList<String>The physiques that are in effect right now.
has(entity, physique)Entity, physique IDbooleanWhether it is held.
enabled(entity, physique)Entity, physique IDbooleanWhether that physique is currently switched on; false when it is not held.
grant(entity, physique)LivingEntity, physique ID{changed, failure}Goes through the authoritative service; holder_condition and exclusive_tags are judged against the current entity.
remove(entity, physique)LivingEntity, physique IDbooleanRemoves that physique together with its attributes, abilities and damage multipliers; false when it was not held.
setEnabled(entity, physique, enabled)LivingEntity, physique ID, boolean{changed, failure}The same switch as a spirit root.

Spirit roots and physiques share one failure vocabulary: DISABLED (that id is not in the registry, including a definition a neoforge:conditions block keeps out), ALREADY_HELD, CONDITIONS (the physique's holder_condition is not met), EXCLUSIVE_CONFLICT, ELEMENT_CONFLICT (the root's conflicting_elements), NOT_HELD and SERVER_ONLY (called on a client). The four readers work on either side, and the state-changing methods are server operations.

// kubejs/server_scripts/mxt_physique.js
const result = MxtPhysiques.grant(player, 'mxt_test:blazing_body')
if (!result.changed) console.warn(`refused: ${result.failure}`)

// Switching it off is not losing it: the body still holds it, nothing it provides applies.
MxtPhysiques.setEnabled(player, 'mxt_test:blazing_body', false)