<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dragonminez.com/index.php?action=history&amp;feed=atom&amp;title=Creating_a_DMZ_Addon</id>
	<title>Creating a DMZ Addon - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dragonminez.com/index.php?action=history&amp;feed=atom&amp;title=Creating_a_DMZ_Addon"/>
	<link rel="alternate" type="text/html" href="https://wiki.dragonminez.com/index.php?title=Creating_a_DMZ_Addon&amp;action=history"/>
	<updated>2026-10-26T16:10:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.dragonminez.com/index.php?title=Creating_a_DMZ_Addon&amp;diff=120&amp;oldid=prev</id>
		<title>Neb: Sync from dragonminez-wiki repository</title>
		<link rel="alternate" type="text/html" href="https://wiki.dragonminez.com/index.php?title=Creating_a_DMZ_Addon&amp;diff=120&amp;oldid=prev"/>
		<updated>2026-10-13T04:15:45Z</updated>

		<summary type="html">&lt;p&gt;Sync from dragonminez-wiki repository&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Creating a DMZ Addon&amp;#039;&amp;#039;&amp;#039; walks you through a full Forge add-on that integrates with DragonMineZ: your own mod jar that depends on DMZ and can react to its events and data. Read [[Special:MyLanguage/Add-on Getting Started|Add-on Getting Started]] first for the required toolchain and versions.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Step 1: Create a Forge 1.20.1 project == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
Start from the Forge MDK for Minecraft &amp;lt;code&amp;gt;1.20.1&amp;lt;/code&amp;gt; with Forge &amp;lt;code&amp;gt;47.4.10&amp;lt;/code&amp;gt;, ForgeGradle &amp;lt;code&amp;gt;6.0.30&amp;lt;/code&amp;gt; and Java &amp;lt;code&amp;gt;17&amp;lt;/code&amp;gt;, matching DMZ.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
These files of the DMZ repository are useful references for your project structure and setup:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gradle.properties&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;build.gradle.kts&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;src/main/resources/META-INF/mods.toml&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Step 2: Set up Gradle == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
DMZ uses the Kotlin Gradle DSL (&amp;lt;code&amp;gt;build.gradle.kts&amp;lt;/code&amp;gt;), but you can use Groovy Gradle or any other setup you prefer for your add-on. Just make sure the Forge and Java versions match. A &amp;lt;code&amp;gt;build.gradle.kts&amp;lt;/code&amp;gt; example:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
plugins {&lt;br /&gt;
    java&lt;br /&gt;
    idea&lt;br /&gt;
    id(&amp;quot;net.minecraftforge.gradle&amp;quot;) version &amp;quot;6.0.30&amp;quot;&lt;br /&gt;
    id(&amp;quot;org.parchmentmc.librarian.forgegradle&amp;quot;) version &amp;quot;1.+&amp;quot;&lt;br /&gt;
    id(&amp;quot;org.spongepowered.mixin&amp;quot;) version &amp;quot;0.7.38&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
repositories {&lt;br /&gt;
    maven(&amp;quot;https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/&amp;quot;) // GeckoLib&lt;br /&gt;
    maven(&amp;quot;https://maven.blamejared.com/&amp;quot;)                             // TerraBlender&lt;br /&gt;
    maven(&amp;quot;https://maven.theillusivec4.top/&amp;quot;)                          // Curios&lt;br /&gt;
    flatDir { dirs(&amp;quot;libs&amp;quot;) }                                            // local DMZ jar&lt;br /&gt;
    mavenCentral()&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
minecraft {&lt;br /&gt;
    mappings(&amp;quot;parchment&amp;quot;, &amp;quot;2023.09.03-1.20.1&amp;quot;)&lt;br /&gt;
    runs {&lt;br /&gt;
        configureEach {&lt;br /&gt;
            workingDirectory(project.file(&amp;quot;run&amp;quot;))&lt;br /&gt;
            // DMZ ships mixins: let the dev runtime remap their refmap&lt;br /&gt;
            property(&amp;quot;mixin.env.remapRefMap&amp;quot;, &amp;quot;true&amp;quot;)&lt;br /&gt;
            property(&amp;quot;mixin.env.refMapRemappingFile&amp;quot;, &amp;quot;${projectDir}/build/createSrgToMcp/output.srg&amp;quot;)&lt;br /&gt;
        }&lt;br /&gt;
        create(&amp;quot;client&amp;quot;)&lt;br /&gt;
        create(&amp;quot;server&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
dependencies {&lt;br /&gt;
    minecraft(&amp;quot;net.minecraftforge:forge:1.20.1-47.4.10&amp;quot;)&lt;br /&gt;
    annotationProcessor(&amp;quot;org.spongepowered:mixin:0.8.7:processor&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    // DMZ&amp;#039;s mandatory dependencies: GeckoLib, TerraBlender &amp;amp; Curios&lt;br /&gt;
    implementation(fg.deobf(&amp;quot;software.bernie.geckolib:geckolib-forge-1.20.1:4.8.3&amp;quot;))&lt;br /&gt;
    implementation(&amp;quot;com.eliotlash.mclib:mclib:20&amp;quot;)&lt;br /&gt;
    implementation(fg.deobf(&amp;quot;com.github.glitchfiend:TerraBlender-forge:1.20.1-3.0.1.10&amp;quot;))&lt;br /&gt;
    compileOnly(fg.deobf(&amp;quot;top.theillusivec4.curios:curios-forge:5.14.1+1.20.1:api&amp;quot;))&lt;br /&gt;
    runtimeOnly(fg.deobf(&amp;quot;top.theillusivec4.curios:curios-forge:5.14.1+1.20.1&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
    // DragonMineZ itself (libs/dragonminez-2.2-alpha.jar)&lt;br /&gt;
    implementation(fg.deobf(&amp;quot;local:dragonminez:2.2-alpha&amp;quot;))&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Step 3: Declare the DMZ dependency == &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
In your add-on&amp;#039;s &amp;lt;code&amp;gt;mods.toml&amp;lt;/code&amp;gt;, add a dependency entry for &amp;lt;code&amp;gt;dragonminez&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;toml&amp;quot;&amp;gt;&lt;br /&gt;
[[dependencies.your_addon_modid]]&lt;br /&gt;
    modId=&amp;quot;dragonminez&amp;quot;&lt;br /&gt;
    mandatory=true # false if your addon also works without DMZ&lt;br /&gt;
    versionRange=&amp;quot;[2.2-alpha]&amp;quot; # Only allow the DMZ version you built against to avoid compatibility issues.&lt;br /&gt;
    ordering=&amp;quot;AFTER&amp;quot;&lt;br /&gt;
    side=&amp;quot;BOTH&amp;quot; # Choose between &amp;quot;CLIENT&amp;quot;, &amp;quot;SERVER&amp;quot;, or &amp;quot;BOTH&amp;quot; based on your addon needs.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Set &amp;lt;code&amp;gt;mandatory&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if your add-on also works without DMZ (see [[Special:MyLanguage/Implementation and Events#Optional dependency pattern|Optional dependency pattern]]). DMZ&amp;#039;s own &amp;lt;code&amp;gt;mods.toml&amp;lt;/code&amp;gt; uses &amp;lt;code&amp;gt;displayTest = &amp;quot;MATCH_VERSION&amp;quot;&amp;lt;/code&amp;gt;, so the client and the server must run the same DMZ version anyway.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Step 4: Add DMZ to the compile classpath == &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
DMZ&amp;#039;s build does not publish a Maven artifact, so use a local jar during development:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
# Download the DMZ release you target, or build it yourself with &amp;lt;code&amp;gt;./gradlew build&amp;lt;/code&amp;gt; in the DMZ repository.&lt;br /&gt;
# Use the &amp;#039;&amp;#039;&amp;#039;no-classifier&amp;#039;&amp;#039;&amp;#039; jar (&amp;lt;code&amp;gt;dragonminez-&amp;lt;version&amp;gt;.jar&amp;lt;/code&amp;gt;): it bundles DMZ&amp;#039;s database libraries. The &amp;lt;code&amp;gt;-slim&amp;lt;/code&amp;gt; jar is not meant to be used.&lt;br /&gt;
# Put it in your project&amp;#039;s &amp;lt;code&amp;gt;libs/&amp;lt;/code&amp;gt; folder and reference it through &amp;lt;code&amp;gt;fg.deobf(...)&amp;lt;/code&amp;gt; as shown above, so ForgeGradle remaps it to your development mappings.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
Use &amp;lt;code&amp;gt;compileOnly&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;implementation&amp;lt;/code&amp;gt; if you only want to compile against DMZ and run it from a separate instance.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Step 5: Listen to DMZ events == &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
DMZ publishes its server and common Forge events as nested classes of &amp;lt;code&amp;gt;com.dragonminez.common.events.DMZEvent&amp;lt;/code&amp;gt;, and its client events as nested classes of &amp;lt;code&amp;gt;com.dragonminez.client.events.DMZClientEvent&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Mod.EventBusSubscriber(modid = &amp;quot;your_addon_modid&amp;quot;, bus = Mod.EventBusSubscriber.Bus.FORGE)&lt;br /&gt;
public class DmzHooks {&lt;br /&gt;
    @SubscribeEvent&lt;br /&gt;
    public static void onTpGain(com.dragonminez.common.events.DMZEvent.TPGainEvent event) {&lt;br /&gt;
        // Example: increase TP gain by 10%&lt;br /&gt;
        int boosted = Math.round(event.getTpGain() * 1.10f);&lt;br /&gt;
        event.setTpGain(boosted);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The event source files are &amp;lt;code&amp;gt;src/main/java/com/dragonminez/common/events/DMZEvent.java&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;src/main/java/com/dragonminez/client/events/DMZClientEvent.java&amp;lt;/code&amp;gt;. The full list, plus the quest objective and reward registries, text placeholders and utility menu slots, is on [[Special:MyLanguage/Implementation and Events|Implementation and Events]].&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Suggested add-on structure == &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;your/addon/MainModClass.java&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;your/addon/event/DmzHooks.java&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;src/main/resources/META-INF/mods.toml&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;src/main/resources/pack.mcmeta&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== First milestone checklist == &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
# The add-on loads without crashing in the development client.&lt;br /&gt;
# DMZ is detected when present.&lt;br /&gt;
# One DMZ event is received in the logs.&lt;br /&gt;
# One behavior change is visible in game.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Compatibility recommendations == &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* Guard code paths that only work with DMZ behind mod-presence checks.&lt;br /&gt;
* Log clear warnings when DMZ is missing or its version is incompatible.&lt;br /&gt;
* Don&amp;#039;t bundle or depend on Legendary Tooltips, Epic Fight or Better Combat: DMZ refuses to start alongside them.&lt;br /&gt;
* Use your own network channel, and never trust client input for progression (see [[Special:MyLanguage/Implementation and Events#Networking|Networking]]).&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Navbox Add-ons}}&lt;/div&gt;</summary>
		<author><name>Neb</name></author>
	</entry>
</feed>