HomeJavaModsdenizen-bulletphys
denizen-bulletphys
ModsJava

denizen-bulletphys

by meigoc · on Modrinth

Real physics for Minecraft, powered by Denizen: falling blocks, suspension-based vehicles, and more.

⬇ Download on Modrinth
denizen-bulletphys

denizen-bulletphys — a real rigid-body physics engine for Denizen.

Falling blocks with inertia and rotation, collisions between bodies and with the terrain, and vehicles on raycast suspension that reacts directly to the blocks under their wheels.


Status: 1.0.0-alpha. The falling-blocks command and the vehicle/suspension command are both implemented and working on a live server. What's still missing for a real 1.0: Denizen ObjectTags/events for bodies and vehicles (right now they're addressed by a plain numeric id).

How it works

The actual physics runs on libbulletjme (a JNI binding to Bullet) on its own thread, stepped at a fixed 60 Hz — decoupled from server TPS. Once per game tick, the main thread reads an immutable snapshot of every body's transform and reflects it into the world through block_display entities with client-side interpolation. MC blocks around active bodies are streamed into a static Bullet collider (loaded/unloaded as bodies move, not a fixed radius around a spawn point) — that's what falling blocks and vehicle wheels actually rest and collide against.

main thread (20 TPS)  ──commands/terrain──►  physics thread (60 Hz, Bullet)
       ▲                                              │
       └──────────  transform snapshot  ◄─────────────┘
       │
   block_display (client-side interpolation)

Using it from Denizen

- physicsbody spawn [<location>] (material:<material>) (size:<#.#>) (mass:<#.#>) (count:<#>)

- physicsvehicle spawn [<location>] (mass:<#.#>) (size:<#.#>,<#.#>,<#.#>) (material:<material>) (save:<name>)
- physicsvehicle <#(id)> addwheel offset:<#.#>,<#.#>,<#.#> (radius:<#.#>) (resting:<#.#>) (steering:<boolean>)
- physicsvehicle <#(id)> drive (wheel:<#>) (steer:<#.#>) (throttle:<#.#>) (brake:<#.#>)
- physicsvehicle <#(id)> remove

Why libbulletjme, not ode4j/jbullet

jBullet has been abandoned since 2008. ode4j is pure Java, but its raycast vehicle suspension would have had to be hand-rolled. libbulletjme is actively maintained, ships PhysicsVehicle with working suspension out of the box, and is already used by the DynamX physics mod for Minecraft.

Requirements

Java 21+ (one jar runs on both 1.21.x / Java 21 and 26.x / Java 25)
Server Paper 1.21.x+ (tested on Leaf 26.2)
Denizen 1.3.3+
Engine libbulletjme 23.1.0 — natives for Linux x64/ARM64, Windows x64, macOS x64/ARM64 bundled in the jar

License

All Rights Reserved.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more