BDApi is a small Java library for creating and animating Minecraft block displays on Paper.
- Paper 1.21.11
- Java 21+
Add the repository and dependency to your plugin:
repositories {
maven("https://maven.rscomeback.fr/releases")
}
dependencies {
implementation("fr.redsavant:bdapi:1.0.0-beta.1")
}Include BDApi in your plugin JAR with Shadow when building your plugin.
To build the library locally instead:
./gradlew buildInitialize BDApi when your plugin starts and shut it down when your plugin stops:
@Override
public void onEnable() {
BDApi.init(this);
}
@Override
public void onDisable() {
BDApi.shutdown(true);
}Create a block display:
DisplayCrate crate = BDApi.get().displays().create()
.at(location)
.block(Material.DIAMOND_BLOCK)
.scale(1.5f)
.spawn();Animate it:
crate.animate()
.moveTo(target)
.rotateTo(0, 180, 0)
.duration(2, TimeUnit.SECONDS)
.easing(Easing.EASE_OUT)
.play();Add physics:
crate.physics()
.gravity()
.bounce(0.4)
.start();Timelines, display groups, transformations, meteor effects and explosion effects are also available.
BDApi is currently available as 1.0.0-beta.1. The API may change between versions.