Add-on Development

From DragonMineZ Wiki

Add-on development means writing your own Forge mod that depends on DragonMineZ and reacts to it: granting bonus TP, listening for form changes, adding new quest objective and reward types, adding buttons to the utility menu and so on. These pages are for Java developers who can run a Forge 1.20.1 development environment.

If you only want to tune numbers or add races, forms, quests or wishes, you don't need any of this: see Modding instead. DragonMineZ has no Java API to register new races, forms, skills or techniques; new races and forms are added through JSON config files.

Guides

Image pending
Who these pages are for, the two ways to extend DMZ and the baseline setup.
Image pending
Toolchain versions, incompatible mods and what an add-on can safely rely on.
Image pending
Every DMZ event, reading player state, extension registries and networking.
Image pending
Set up the Gradle project, declare the dependency and receive your first event.

The project

Image pending
Report bugs, suggest features, build the mod and open pull requests.
Image pending
How to report a vulnerability and how to keep a server safe.

Reading order

  1. Add-on Getting Started: match the toolchain and make sure your development environment builds against DMZ.
  2. Implementation and Events: wire up the actual hooks.
  3. Creating a DMZ Addon: the full Gradle and mods.toml setup.

Ground rules for add-ons

  • Hook com.dragonminez.common almost exclusively: it is the shared, most stable layer. On the client, the only hooks meant for add-ons are DMZClientEvent and the utility menu slots.
  • Prefer reacting to DMZ events (changing their settable fields, or cancelling them) over changing DMZ data directly.
  • Register your own network channel; never add packets to DMZ's channel.
  • Never trust client input for stats, unlocks, quests, wishes or progression: validate it on the server.
  • Don't depend on com.dragonminez.mixin classes or on DMZ internals that the guides don't mention; they can change without notice between versions.
  • Don't bundle or depend on Legendary Tooltips, Epic Fight or Better Combat: DMZ refuses to start alongside them.