Skip to content

Get Started with Minestom

Add the repository below to your build config:

https://repo.znotchill.me/repository/maven-releases/

Example:

repositories {
mavenCentral()
maven { url = uri("https://repo.znotchill.me/repository/maven-releases/") }
}

Add the library:

me.znotchill.marmot:minestom-api:LATEST
me.znotchill.marmot:common:LATEST

Replace LATEST with whichever version is latest according to the GitHub. Currently, it is 1.2.12.

Once you have finished installation, you can add the Marmot API to your Minestom server:

MarmotAPI.registerEvents(MinecraftServer.getGlobalEventHandler())
MarmotAPI.registerTasks(MinecraftServer.getSchedulerManager())

Or, alternatively, if you are using Blossom:

MarmotAPI.registerEvents(eventHandler)
MarmotAPI.registerTasks(scheduler)

Now, the Marmot API is hooked into your server and everything is good to go! The API handles all of the internals so you don’t have to worry about anything.

Now the API is hooked, you can hook into Marmot events, for example:

MarmotAPI.addEvent(MarmotEvent.LEFT_CLICK_BEGIN) { player ->
player.sendMessage("${player.username} began holding left click!")
}
MarmotAPI.addEvent(MarmotEvent.LEFT_CLICK_END) { player ->
player.sendMessage("${player.username} stopped holding left click!")
}

Since the Marmot API is unified across all server softwares, the API specification works anywhere.