Project Setup
To use Bestium, you need to start with a working Paper plugin setup. Your build must use either Gradle Kotlin DSL or Gradle Groovy DSL. Maven cannot be used, because paperweight-userdev does not support Maven.
Add dependencies
Section titled “Add dependencies”To use Bestium in your plugin project, you’ll need two dependencies:
- paperweight-userdev for access to Minecraft internals (also known as NMS).
- Bestium API for using Bestium’s entity injection tools.
Your Gradle build configuration should look something like this:
plugins { id("io.papermc.paperweight.userdev") version "2.0.0-beta.18"}
repositories { mavenCentral()}
dependencies { compileOnly("cz.jeme:bestium:3.0.1") paperweight.paperDevBundle("1.21.8-R0.1-SNAPSHOT")}
kotlin { jvmToolchain(21)}
plugins { id 'io.papermc.paperweight.userdev' version '2.0.0-beta.18'}
repositories { mavenCentral()}
dependencies { compileOnly 'cz.jeme:bestium:3.0.1' paperweight.paperDevBundle('1.21.8-R0.1-SNAPSHOT')}
plugins { id("io.papermc.paperweight.userdev") version "2.0.0-beta.18"}
repositories { mavenCentral()}
dependencies { compileOnly("cz.jeme:bestium:3.0.1") paperweight.paperDevBundle("1.21.8-R0.1-SNAPSHOT")}
java { toolchain.languageVersion.set(JavaLanguageVersion.of(21))}
plugins { id 'io.papermc.paperweight.userdev' version '2.0.0-beta.18'}
repositories { mavenCentral()}
dependencies { compileOnly 'cz.jeme:bestium:3.0.1' paperweight.paperDevBundle('1.21.8-R0.1-SNAPSHOT')}
Verify your setup
Section titled “Verify your setup”Once your build is synced, you should be able to import main Bestium class:
import cz.jeme.bestium.api.Bestium
import cz.jeme.bestium.api.Bestium;
Converting to a Paper plugin
Section titled “Converting to a Paper plugin”To use Bestium, your plugin must be a Paper plugin.
This means replacing your plugin.yml
with a paper-plugin.yml
.
Follow this guide to migrate from Bukkit to Paper plugin format.
Creating a Bootstrapper
Section titled “Creating a Bootstrapper”Bootstrappers allow you to run code very early in the Minecraft server’s startup sequence. This is essential for registering custom entities with Bestium.
To use a bootstrapper:
- Implement the
PluginBootstrap
interface:MyPluginBootstrapper.kt package com.example.mypluginimport io.papermc.paper.plugin.bootstrap.BootstrapContextimport io.papermc.paper.plugin.bootstrap.PluginBootstrap@Suppress("UnstableApiUsage")internal class MyPluginBootstrapper : PluginBootstrap {override fun bootstrap(context: BootstrapContext) {// Here the injection will happen}}MyPluginBootstrapper.java package com.example.myplugin;import io.papermc.paper.plugin.bootstrap.BootstrapContext;import io.papermc.paper.plugin.bootstrap.PluginBootstrap;@SuppressWarnings("UnstableApiUsage")public class MyPluginBootstrapper implements PluginBootstrap {@Overridepublic void bootstrap(BootstrapContext context) {// Here the injection will happen}} - Register your bootstrapper class in
paper-plugin.yml
:paper-plugin.yml bootstrapper: com.example.myplugin.MyPluginBootstrapper
Adding Bestium plugin dependency
Section titled “Adding Bestium plugin dependency”To access Bestium’s API during runtime, you need to add it as a plugin dependency.
This can be achieved by adding the following lines to your paper-plugin.yml
:
dependencies: bootstrap: Bestium: load: BEFORE required: true join-classpath: true server: Bestium: join-classpath: true