Skip to main content

Java API

MiXianTu is a framework: the mod ships the runtime that resolves data definitions, and the concrete content is supplied by datapacks, KubeJS or another content mod. A Java extension should reuse the existing data definitions, actions, conditions, costs and runtime services first, and add its own gameplay on top of them.

Public API

APIPurpose
MxtDatapackRegistriesQueries native datapack registries, holders, disabled tags and client-synchronised data.
AuraServiceQueries the final aura at a position, its environment sources, the per-resource aura pools and area overrides; a resource may carry element markers.
ResourceServiceInitialises, reads and modifies resources, and performs maximum and regeneration calculations.
CultivationServiceCultivation, resource conversion, realm breakthrough and realm assignment.
AbilityServiceServer-side ability execution, costs, cooldowns, cancellation and actions.
CurrencyValueServiceComputes an item's currency value and the reason it is unavailable.
ItemMatcher / UniversalMatcherMatches items, tags, wildcards, regular expressions and mixed arrays.
NumberProviderConstants, expressions, registry type dispatch and finite value handling.
warning

Unless an interface is explicitly marked as a client API, do not call server lifecycle registry queries from the render thread.

Extension Surfaces

SurfaceWhat an addon can do
Datapack registriesAdd or override data table entries under data/<namespace>/mxt/; see JSON Data Formats.
AttachmentsStore per-entity, per-level and per-chunk state in NeoForge attachment types; the mod registers its own in MxtAttachments, for example CULTIVATION, SPIRIT_IDENTITY and RESOURCE_HOLDER, and they are read with entity.getData(...).
Actions and conditionsReuse the built-in entity, bi-entity, block, item and damage action and condition types, or register new built-in types; see Types Reference.
Number providersSupply any numeric field from a constant, an expression or a registered provider type; see Number Provider Types.
Information panelAdd your own lines to the character information panel with InformationManager; see Information Panel.
Hotbar entriesAdd a client-side hotbar entry by implementing HotbarEntry; see Hotbar Entries.

Next Steps