Skip to content

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.

To use Bestium in your plugin project, you’ll need two dependencies:

Your Gradle build configuration should look something like this:

build.gradle.kts
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)
}

Once your build is synced, you should be able to import main Bestium class:

import cz.jeme.bestium.api.Bestium

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.

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:

  1. Implement the PluginBootstrap interface:
    MyPluginBootstrapper.kt
    package com.example.myplugin
    import io.papermc.paper.plugin.bootstrap.BootstrapContext
    import io.papermc.paper.plugin.bootstrap.PluginBootstrap
    @Suppress("UnstableApiUsage")
    internal class MyPluginBootstrapper : PluginBootstrap {
    override fun bootstrap(context: BootstrapContext) {
    // Here the injection will happen
    }
    }
  2. Register your bootstrapper class in paper-plugin.yml:
    paper-plugin.yml
    bootstrapper: com.example.myplugin.MyPluginBootstrapper

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:

paper-plugin.yml
dependencies:
bootstrap:
Bestium:
load: BEFORE
required: true
join-classpath: true
server:
Bestium:
join-classpath: true