Skip to main content

Types Reference

Actions, conditions, number providers and the like are type tables held by the code of the mod: every entry is registered under an ID, and a data pack writes type to pick one.

{
"type": "mxt:heal",
"amount": 2
}

type goes in the object that carries the parameters, level with them, with no extra wrapper around it.

A data pack can only pick an existing type, never add one: an unknown type fails the load. New types are registered in code or from a script.

Always write type with its full ID: the built-in types live in the mxt: namespace, so "and" is read as minecraft:and and the load fails with "no such type".

Several families accept shorthand: a JSON number is mxt:constant, a string is mxt:expression, and an item ID such as "minecraft:apple" is the matcher entry mxt:item. Wherever a shorthand exists, writing the full typed object works just as well.

One dispatch registry per page, hung under the definition page that writes it: Ability Types, Ability Target Selector, Data Storage and Mount Renderers are under ability; Curse Types under curse; Formation Actions under formation; a formation's stroke kinds under formation_shape; Timeline Entries under tribulation; Secret Realm Generations under secret_realm; the four resource bar families (context, renderer, visibility, value source) under resource; Aura Maximum under aura_zone; Triggers under trigger. Actions, conditions, costs, the item matcher, number providers and formula variables are referenced all over a pack and belong to no single definition, so they stay in this group.

Dispatched Fields​

FieldType familySee
type (top level of an ability)Ability type saturn:ability_typeAbility Types
render.typeMount renderer mxt:mount_render_typeMount Renderers
typeTarget selector saturn:ability_target_selector_typeAbility Target Selector
typeState kind saturn:data_storage_typeData Storage
typeCurse type mxt:curse_typeCurse Types
typeTrigger saturn:trigger_typeTriggers
typeCost saturn:cost_typeCosts
typeFormation module mxt:formation_action_typeFormation Actions
type (each stroke of a figure)Formation stroke mxt:formation_stroke_typeFormation Stroke Types
typeTribulation beat saturn:timeline_entry_typeTimeline Entries
typeSecret realm generation mxt:secret_realm_generation_typeSecret Realm Generations
typeResource value source saturn:resource_value_provider_typeResource Value Providers
typeAura maximum mxt:aura_maximum_typeAura Maximum
context (ID string)Resource bar context saturn:resource_bar_contextResource Bar Contexts
renderer.typeResource bar renderer saturn:resource_bar_render_data_typeResource Bar Renderers
visibility.typeResource bar visibility saturn:resource_bar_visibility_typeResource Bar Visibility
typeItem matcher entry saturn:item_matcher_entry_typeItem Matcher
typeEntity actionEntity Action Types
typeBi-entity actionBi-entity Action Types
typeBlock actionBlock Action Types
typeItem actionItem Action Types
typeEntity conditionEntity Condition Types
typeBi-entity conditionBi-entity Condition Types
typeBlock conditionBlock Condition Types
typeItem conditionItem Condition Types
typeDamage conditionDamage Condition Types
typeNumber provider saturn:number_provider_typeNumber Provider Types
A name, not a fieldFormula variable saturn:formula_variableFormula Variables

Action and condition arrays are shorthand for running all of them, in order:

"entity_action": [
{"type": "mxt:heal", "amount": 2},
{"type": "mxt:apply_curse", "curse": "example:burning", "stacks": 1}
]

Shared Data Types​

Complex values shared by many fields are documented once in Shared Data Types: Cost, AuraGain, AttributeEntry, icon references, holders and tags, ItemMatcher, and formulas.

Types Handed to Scripts​

With a few exceptions every family pre-registers an mxt:js type, which is also the only type that hands behaviour to a script. A script registers a callback in kubejs/server_scripts/ and a data pack refers to it by id:

Dispatchmxt:js fieldsRegister with
Entity / bi-entity / block / item actionid, paramsMxtActions.entity / biEntity / block / item
Entity / bi-entity / block / item / damage conditionid, paramsMxtConditions.entity / biEntity / block / item / damage
Number providerid, paramsMxtValues.number
Resource value sourceid, paramsMxtValues.resourceValue
Costid, paramsMxtCosts.register
Triggersignal, id, paramsMxtTriggers.matcher
Ability target selectorid, paramsMxtAbilities.selector
Vanilla loot condition / functionid, paramsMxtLoot.condition / MxtLoot.function

A mxt:js trigger writes one extra field, signal: the runtime dispatches by signal layer. Callbacks run on the server. A missing or throwing callback falls back to a safe value each time — an action does nothing, a condition is false, a number resolves to 0, a cost cannot be paid, a trigger never matches, a selector selects nobody — and logs a warning.

A Trigger needs that signal because the runtime indexes subscriptions as "signal → owner → subscriber". Apart from Cost, every callback also gets the formula context of the dispatch; Cost is only ever evaluated for a player, so its context is built from that player alone and carries no event payload. Loot conditions and functions are written inside a vanilla loot table (the condition / function dispatch keys) and likewise only run on the server while loot is generated.