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.
Configure the repository
Section titled “Configure the repository”Add Maven Central for external dependencies and Asorda Public for Twaddle modules:
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.
Artifact coordinates
Section titled “Artifact coordinates”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").
Use an independent feature
Section titled “Use an independent feature”This inventory reserves the last slot against incoming shift-clicks. Add only the transfer module:
dependencies { implementation("org.everbuild.twaddle:twaddle-transfer-rules:0.1.0")}import net.minestom.server.entity.Playerimport net.minestom.server.inventory.Inventoryimport net.minestom.server.inventory.InventoryTypeimport org.everbuild.twaddle.inventory_transfer.TransferRegionimport 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())import net.minestom.server.entity.Player;import net.minestom.server.inventory.Inventory;import net.minestom.server.inventory.InventoryType;import org.everbuild.twaddle.inventory_transfer.InventoryTransferHandler;import org.everbuild.twaddle.inventory_transfer.TransferRegion;import org.everbuild.twaddle.inventory_transfer.TransferRuleset;
class RoutedChest extends Inventory { private final InventoryTransferHandler transfers = TransferRuleset.builder() .blockAt(8, context -> context.getRegion() != TransferRegion.OPEN_INVENTORY) .vanillaBehaviour() .build().bindTo(this);
RoutedChest() { super(InventoryType.CHEST_1_ROW, "Routed chest"); }
@Override public boolean shiftClick(Player player, int slot, int button) { return transfers.shiftClick(player, slot, button); }}
// In an existing player command or event callback:player.openInventory(new 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.
Manage your server lifecycle
Section titled “Manage your server lifecycle”Add twaddle-lifecycle when your application needs resource and coroutine ownership. Feature modules declare their own dependencies.
dependencies { implementation("org.everbuild.twaddle:twaddle-lifecycle:0.1.0")}Structure application setup in this order:
- Twaddle creates the root context.
- Pre-init modules are installed.
- Minestom is initialized.
- 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.awaitCancellationimport net.minestom.server.Authimport net.minestom.server.MinecraftServerimport 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()}Create a TwaddleContext manually and wrap the process lifetime with try/finally.
import net.minestom.server.Auth;import net.minestom.server.MinecraftServer;import org.everbuild.twaddle.lifecycle.TwaddleContext;import java.util.concurrent.CountDownLatch;
void main() throws InterruptedException { var cx = TwaddleContext.root();
try { // Install pre-init modules here
var minecraftServer = MinecraftServer.init(new Auth.Online()); var serverCx = cx.initialized(minecraftServer);
// Pass serverCx to post-init modules here
minecraftServer.start("0.0.0.0", 25565); new CountDownLatch(1).await(); } finally { cx.shutdownNow(); }}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.
Adopt other optional capabilities
Section titled “Adopt other optional capabilities”Choose the capabilities your server needs:
- Inventory transfer rules for shift-click routing.
- Stacked behaviour for ordered rules across typed activities.
- Block behaviour for Minestom block callbacks and configuration.
- Random ticking for sampled block updates.