Skip to main content

Java plugin API

Generated Java reference includes searchable classes, methods and signatures, with the source version and commit recorded for each module.

Use this section when writing a Java plugin that integrates with Nightbreak plugins. For authored gameplay without a Java plugin, start with the Lua scripting guide.

Choose a plugin​

All coordinates below use the group com.magmaguy. These versions are listed in the public Maven repository at this refresh; match the version to the plugin installed on your server. Current-source wiki pages and generated references can cover a newer build before its Maven artifact is published.

PluginArtifact and versionDeveloper reference
EliteMobsEliteMobs:10.9.10Entities, items, events, Lua power and Mind services
FreeMinecraftModelsFreeMinecraftModels:2.12.9Models, interactions, disguises, items and magic weapons
ResourcePackManagerResourcePackManager:2.4.7Pack registration and reloads
BetterStructuresBetterStructures:2.7.9Structure generation events
EternalTDEternalTD:1.7.8Tower, wave and combat events
CannonRTPCannonRTP:1.2.8Launch, destination validation and landing events
ResurrectionChestResurrectionChest:2.3.7Integration scope
BetterFoodBetterFood:1.5.6Integration scope
MagmaCoreMagmaCore:2.2.0-SNAPSHOTEmbedded library setup and lifecycle

Add a plugin dependency​

Released plugins resolve from MagmaGuy's Maven repository. Compile against the installed plugin with Maven provided or Gradle compileOnly. Your integration JAR should not contain a second copy of that plugin.

For example, an EliteMobs integration uses:

pom.xml sections
<repositories>
<repository>
<id>magmaguy-releases</id>
<url>https://repo.magmaguy.com/releases</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.magmaguy</groupId>
<artifactId>EliteMobs</artifactId>
<version>10.9.10</version>
<scope>provided</scope>
</dependency>
</dependencies>

The equivalent Gradle Kotlin DSL is:

build.gradle.kts sections
repositories {
maven("https://repo.magmaguy.com/releases")
}

dependencies {
compileOnly("com.magmaguy:EliteMobs:10.9.10")
}

Your project also needs its normal Bukkit/Paper API dependency. Use Java 21 for these examples, and run the Java version required by your server.

Declare the runtime dependency in your plugin descriptor:

plugin.yml section
depend: [EliteMobs]

Replace the artifact, version and plugin name for a different integration. BetterStructures also requires WorldEdit on the server. ResourcePackManager's Java registration API runs on the Bukkit backend; the universal artifact also contains proxy components, but that does not make this Bukkit API callable from a proxy plugin.

If the integration is optional, use softdepend and only load the integration's classes after checking that the target plugin is enabled. Keep references to optional plugin types out of your always-loaded entry point. Dependency order alone does not mean asynchronous content initialization has finished; follow the target plugin's readiness and reload hooks.

MagmaCore has a different packaging contract. It is an embedded library, so follow its shading and lifecycle guide instead of this installed-plugin recipe.

Lifecycle and compatibility​

Use the entry points documented in each guide. A public Java class in a plugin JAR can still be an implementation detail. Check the matching release's signatures before upgrading, especially when using managers or entity classes outside an api package.

Run Bukkit entity and world operations on the server thread. Avoid blocking event handlers with HTTP, file access or long computations. Re-check entities and plugin readiness when returning from asynchronous work.

Keep only the state your integration owns. Release its model attachments, registrations and tasks when it disables, and reacquire target-plugin objects after a reload. A saved reference to a model or dungeon is not proof that its runtime still exists.

ResurrectionChest​

ResurrectionChest 2.3.7 has no dedicated custom Bukkit event API or integration facade. Its events package contains internal Bukkit listeners. Do not construct those listeners as extension points.

Use the documented configuration and commands for server setup. The published Maven artifact lets an integration compile against the release, but does not establish a stable chest-management contract.

To build the plugin yourself, see Building from source.

BetterFood​

BetterFood 1.5.6 has no dedicated custom Bukkit event API or integration facade. Its food-selection logic runs through its own Bukkit listeners.

Use the behavior guide and setup reference for supported setup. Code that hooks ordinary Bukkit events should respect cancellation and event priority rather than call BetterFood's internal listeners directly.

To build the plugin yourself, see Building from source.

Class and method documentation​

Use the guides above for integration patterns and the generated Java reference for classes, methods and signatures. Check the version and source commit recorded in the generated reference against the release your integration uses.