Skip to main content

Java API

Java extensions should reuse the existing data definitions, actions, conditions, costs and runtime services first. When adding gameplay, decide on the server-side settlement entry point first, and only then add the client display and the network payload.

Extension Surfaces​

SurfaceWhat an addon can do
Datapack registriesAdd or override 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.
Formation modulesAdd a formation module by writing one FormationActionType record and registering it; see Public API.
Information panelAdd your own lines to the character information panel with InformationManager; see Information Panel.
Wheel entriesAdd a client-side wheel entry by implementing WheelMenuEntry; see Wheel Entries.

Next Steps​

  • Public API — the runtime services an addon calls into, from AuraService to DefinitionText.
  • Interfaces — one page per interface: aura storage, creature contracts, the wheel and keys, definitions and costs, alchemy.
  • Registries and Codecs — built-in type registries, the datapack registry list and the codec naming convention.
  • Network Protocol and Server Authority — every C2S and S2C payload, and the one channel that carries item contents.
  • Information Panel — register your own lines in the character information panel.
  • Wheel Entries — how to add an entry to the client wheel.
  • Client Screens — where the screens live, and how this mod's definitions become rows in the item picker.
  • Types Reference — every built-in action and condition type.
  • JSON Data Formats — every field of every definition.
  • Datapack Overview — the datapack directory layout and when changes take effect.
  • KubeJS API — the scripted alternative for content that does not need Java.