Get Started with Paper
Installation
Section titled “Installation”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:paper-api:LATESTme.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 Paper server:
MarmotAPI.registerEvents(JavaPlugin)MarmotAPI.registerTasks(JavaPlugin)
Full example:
class MarmotPaperTest : JavaPlugin() { override fun onEnable() { MarmotAPI.registerEvents(this) MarmotAPI.registerTasks(this) }}
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.