Skip to main content

Loot and Advancement Criteria

Besides datapack registries, MiXianTu registers a small set of vanilla types so that content packs can read and change a player's cultivation state from ordinary loot tables, loot modifiers and advancements. They are written as "type": "mxt:..." inside normal vanilla JSON — there is no special file layout.

File Locations

KindWhere it is used
Advancement criteriadata/<namespace>/advancement/<id>.json, in the criteria section
Loot functions and loot conditionsdata/<namespace>/loot_table/<id>.json, or any other JSON that accepts vanilla loot functions and conditions, such as block or entity loot tables and loot modifiers

Advancement Criteria

All four criteria share one shape: an optional definition filter plus the standard vanilla player predicate.

CriterionFires whendefinition holds
mxt:breakthroughA breakthrough succeedsThe realm stage that was reached
mxt:abilityAn ability is used, including every ability executed as part of a composite castThe ability
mxt:alchemyAn alchemy batch completesThe recipe
mxt:tribulationA tribulation completes successfullyThe tribulation
FieldTypeDefaultDescription
playerContextAwarePredicatenoneStandard vanilla predicate on the player who earns the advancement
definitionIdentifiernoneOnly fires for this definition; when it is omitted, any definition fires the criterion
{
"criteria": {
"foundation": {
"trigger": "mxt:breakthrough",
"conditions": {
"definition": "example:foundation"
}
}
},
"requirements": [["foundation"]]
}

Loot Conditions

A loot condition uses the vanilla "condition" dispatch key: {"condition": "mxt:has_ability", ...}.

ConditionTrue whenRequired field
mxt:has_abilityThe entity has been granted the abilityability
mxt:has_curseThe entity currently carries the cursecurse
mxt:realmThe entity is in that realm, in any resource chainrealm
mxt:has_spirit_rootThe entity has that spirit rootspirit_root
mxt:has_physiqueThe entity has that physiquephysique
FieldTypeDefaultDescription
entityEntityTargetthisWhich entity of the loot context is checked: this, attacker, direct_attacker, attacking_player, target_entity or interacting_entity

When the selected entity is not present in the loot context, the condition is false.

{
"conditions": [
{"condition": "mxt:has_spirit_root", "spirit_root": "example:fire_root"},
{"condition": "mxt:realm", "realm": "example:foundation"}
]
}

Loot Functions

A loot function uses the vanilla "function" dispatch key: {"function": "mxt:grant_ability", ...}. All three functions also accept the vanilla conditions field.

FunctionEffect
mxt:grant_abilityGrants a persistent ability source to an entity and refreshes its trigger subscriptions
mxt:set_artifact_ownerAssigns the dropped artifact to an entity, then runs the archetype's refine_action
mxt:apply_curseApplies a curse to an entity, with loot as the application source

mxt:grant_ability

FieldTypeDefaultDescription
abilityIdentifierrequiredThe ability to grant
entityEntityTargetthisThe entity that receives the ability
sourceIdentifiermxt:lootSource id recorded with the grant, so the ability can be revoked per source
{
"function": "mxt:grant_ability",
"ability": "example:fire_manual",
"source": "example:fire_temple"
}

mxt:set_artifact_owner

FieldTypeDefaultDescription
entityEntityTargetthisThe entity that becomes the artifact's owner

If the stack already belongs to another owner, nothing happens: the drop is left untouched and the refine action is not run.

{
"function": "mxt:set_artifact_owner"
}

mxt:apply_curse

FieldTypeDefaultDescription
curseIdentifierrequiredThe curse to apply
stacksInteger 1..2561How many stacks of the curse to apply
entityEntityTargetthisThe entity that receives the curse
{
"function": "mxt:apply_curse",
"curse": "example:blood_oath",
"stacks": 2
}

Putting It Together

A chest that only drops a manual for a player who already has the matching spirit root:

{
"type": "minecraft:chest",
"pools": [
{
"rolls": 1,
"entries": [
{"type": "minecraft:item", "name": "minecraft:book"}
],
"conditions": [
{"condition": "mxt:has_spirit_root", "spirit_root": "example:fire_root"}
],
"functions": [
{"function": "mxt:grant_ability", "ability": "example:fire_manual"}
]
}
]
}