Skip to content

Getting started

Twaddle modules use the Maven group org.everbuild.twaddle and are published to the Asorda public repository. The examples below use 0.1.0, the version configured in gradle.properties. Choose a published version from the GitHub releases and use it consistently across all Twaddle dependencies. A release tagged v0.1.0 uses Maven version 0.1.0.

Start with an existing Minestom server. Choose one of the following two paths:

Most features are independent of the server lifecycle.

Add Maven Central for external dependencies and Asorda Public for Twaddle modules:

build.gradle.kts
repositories {
mavenCentral()
maven {
name = "asordaPublic"
url = uri("https://mvn.everbuild.org/public")
}
}

If your build manages repositories in settings.gradle.kts, place the same repository entries inside dependencyResolutionManagement { repositories { ... } } instead. Consumers do not need the publishing credentials or a local checkout of Twaddle.

Use Java 25 and keep your server’s Minestom dependency. Most Twaddle modules declare Minestom as compileOnly, so your application must supply it. This source version builds against net.minestom:minestom:2026.07.12-26.2.

All artifacts share the group org.everbuild.twaddle and the release version. Choose individual modules as needed; their published metadata resolves transitive dependencies.

Artifact ID Purpose
twaddle-lifecycle Application lifetime and coroutine ownership
twaddle-structured-logging Structured logging helpers
twaddle-common-minestom Minestom event and packet helpers
twaddle-common-block Shared block APIs
twaddle-stacked-behaviour Ordered rules across typed activities
twaddle-stacked-behaviour-block Stacked rules for Minestom block callbacks
twaddle-transfer-rules Inventory shift-click routing
twaddle-random-ticking Sampled block updates
twaddle-data-driven Load data files from any format you like
twaddle-datapack-primitives Number providers, predicates, and slot sources
twaddle-loot Loot-table codecs and loot generation
twaddle-testing Testing utilities; use testImplementation
twaddle-data-driven-testing Data-driven codec fixture tests; use testImplementation

For example, testing utilities use testImplementation("org.everbuild.twaddle:twaddle-testing:0.1.0").

This inventory reserves the last slot against incoming shift-clicks. Add only the transfer module:

build.gradle.kts
dependencies {
implementation("org.everbuild.twaddle:twaddle-transfer-rules:0.1.0")
}
import net.minestom.server.entity.Player
import net.minestom.server.inventory.Inventory
import net.minestom.server.inventory.InventoryType
import org.everbuild.twaddle.inventory_transfer.TransferRegion
import org.everbuild.twaddle.inventory_transfer.transferRuleset
class RoutedChest : Inventory(InventoryType.CHEST_1_ROW, "Routed chest") {
private val transfers = transferRuleset {
blockAt(8) { region != TransferRegion.OPEN_INVENTORY }
vanillaBehaviour()
}.bindTo(this)
override fun shiftClick(player: Player, slot: Int, button: Int): Boolean =
transfers.shiftClick(player, slot, button)
}
// In an existing player command or event callback:
player.openInventory(RoutedChest())

This controls shift-click routing, not ordinary clicks. Continue with Inventory transfer rules for conditional destinations, or try the copper trapdoor tutorial to create, modify, and register stacked block rules.

Add twaddle-lifecycle when your application needs resource and coroutine ownership. Feature modules declare their own dependencies.

build.gradle.kts
dependencies {
implementation("org.everbuild.twaddle:twaddle-lifecycle:0.1.0")
}

Structure application setup in this order:

  1. Twaddle creates the root context.
  2. Pre-init modules are installed.
  3. Minestom is initialized.
  4. Modules that need the server are installed.

Create the server directly and wrap the process lifetime with runTwaddleApplication. When the application block finishes or fails, the context cancels lifetime coroutine work and closes owned resources.

import kotlinx.coroutines.awaitCancellation
import net.minestom.server.Auth
import net.minestom.server.MinecraftServer
import org.everbuild.twaddle.lifecycle.runTwaddleApplication
suspend fun main() = runTwaddleApplication { cx ->
// Install pre-init modules here
val server = MinecraftServer.init(Auth.Online())
val serverCx = cx.initialized(server)
// Pass serverCx to post-init modules here
server.start("0.0.0.0", 25565)
awaitCancellation()
}

The wait after start(...) is deliberate. Minestom starts its server threads and returns, while the Twaddle context must stay alive for as long as those threads do. Replace the indefinite wait with your application’s shutdown signal when it has one.

Choose the capabilities your server needs: