CRUX

Rigidbody — physics

Overview

DescriptionAttach a Rigidbody to a display, a model, or an empty object with box colliders for gravity, force, velocity, collisions, friction, bounce, buoyancy and joints. Mass, friction, bounce, center of mass and inertia are computed automatically from the look's blocks (or entered by hand). Velocity and force are in blocks per second. Simulated in one place only, the server, so every player sees the same position and the same result. Clients only interpolate between the positions they receive.
StatusAvailable

Nodes

NodePinsNotes
Add force
obj.push
object · velocity(x y z) · forcePoint(x y z) · forceModeFour modes — impulse (divided by mass, once), force (divided by mass, for this tick), velocity change (ignores mass, once), acceleration (ignores mass, for this tick). With a force point (world position) the force is applied there and spins the body (torque = (point − center of mass) × force); empty = center of mass. Wakes a sleeping body. Java Rigidbody.pushAt.
Set velocity
obj.setVelocity
object · velocity(x y z)Replaces the velocity and wakes the body.
Set kinematic
obj.setKinematic
object · onWhen on, the body ignores physics and moves only through move nodes. Bodies on top are carried by friction and players or mobs ride along (moving platforms, elevators).
Set gravity
obj.gravity
object · on
Velocity
obj.velocity
object → velocity
Speed
obj.speed
object → 블록/초The magnitude of the velocity vector.
Is sleeping
obj.isSleeping
object → bool
Get / set mass, friction, bounce
cv.physics.mass
object → value (cv.physics.mass · friction · bounce · .set)Component value nodes. Setting mass, friction or bounce from a node turns Auto physics off for that body.
On collision enter
ev.obj.collide
→ object · other · speed · point · normal · impulse · blockAn empty other means world blocks (block gives the cell). point is the contact point, normal points from the other toward this body, impulse is mass × blocks/s.
While colliding
ev.obj.collideStay
→ object · other · point · normal · impulse · blockEvery 4 ticks. Not while asleep.
On collision exit
ev.obj.collideExit
→ object · other
On trigger enter
ev.obj.triggerEnter
→ object · otherA collider trigger box. Checked every 4 ticks.
While in trigger
ev.obj.triggerStay
→ object · otherEvery 4 ticks.
On trigger exit
ev.obj.triggerExit
→ object · other
On body sleep
ev.obj.sleep
→ object
On body wake
ev.obj.wake
→ object
Set entity velocity
entity.velocity
entity · velocity(x y z)Also works on entities that are not objects.

Nodes and the Java code below do the same thing. Each node corresponds to one Java method.

Java

Current API — CruxComponent onCollide(Collision), onCollideStay and onCollideExit — crux.engine.Collision carries the other object, point, normal and impulse

// A crate that breaks on a hard hit — particles at the contact point
@Override public void onCollide(crux.engine.Collision c) {
    if (c.impulse() < 30) return;
    var p = c.point();
    command("particle minecraft:block{block_state:\"minecraft:oak_planks\"} " + p.x() + " " + p.y() + " " + p.z() + " 0.3 0.3 0.3 0 40");
    if (c.gameObject() != null) c.gameObject().rigidbody().push(c.normal().scale(-0.3));
    GameObject.self().destroy();
}

In game

PlayerWhat they see
Vanilla clientDisplays (1.19.4+) or armor stands (1.19.3 and earlier) move to the server-computed position. On 1.20.2+ position and rotation are interpolated over the update interval (1, 2 or 4 ticks). Blocking surfaces are invisible shulkers that move with the body (only for players within 48 blocks).
With the server resource packSame as vanilla.
Crux clientThe same server result as vanilla, plus the client receives the body boxes and collides with them directly (no shulkers, so no stutter when pushing), plus interpolation on older versions (1.20.1 displays; armor stands on 1.18.2, 1.16.5 and 1.12.2). No prediction, so everyone sees the same position.

Supported versions · server software

TargetMethod
Display, model, physics form — 1.12.2 to 26.3Server physics. Armor stands on 1.19.3 and earlier (rotation and size limited)
Minecraft blockNo Rigidbody — blocks stay real blocks (redstone, container slots and light keep working). Moving blocks come from the free official asset Block Physics (in preparation)
NPC · entityMinecraft physics (gravity, push, knockback). On 26.2+ bounce, friction and air drag map to vanilla attributes
SmoothnessVanilla interpolation on 1.20.2+; Crux Client interpolation below (1.20.1, 1.18.2, 1.16.5, 1.12.2)
Pushing with movement keysPaper 1.21.3+, Fabric 26.x (versions where the vanilla client sends input)

Where to configure

Server window (operation)Server object → Physics settings (collision table: one 'tag tag' pair per line, player and entity allowed)
Crux Editor (creation)Object Inspector → Add component → Collider, Rigidbody, Joint. Rigidbody fields Auto physics, Auto center of mass and Auto inertia. Hierarchy right-click → Freeze physics (with children). Things the current embodiment cannot do show a yellow note

Planned

  • Break force on fixed, hinge and slider joints
  • Free official asset Block Physics (block → body → block again, built from nodes)
  • Player hitbox from the collider (1.20.5+ scale, Crux Client)

Model — look, collider, rigidbody, embodiment

An object is an id, a Transform and components. Look, collider and rigidbody are components too. What appears in Minecraft (displays, armor stands, shulkers) is the embodiment, chosen automatically by the server from the components.

LookWith a RigidbodyNotes
DisplayThe display itself is the body. Auto collider = its size boxArmor stand on 1.19.3 and earlier
ModelThe model follows an invisible body (the collider boxes)Auto collider = 0.8 × 1.8 × size
Physics form (empty object + box colliders)Up to 16 boxes as one body, one display child per boxLooks come from child displays or models
NPC · entityMinecraft physics as isNo mass or joints
Minecraft blockNot allowedBlock Physics asset (in preparation)
  • Collider component: 'Auto' (from the look) or manual boxes — one 'x y z w h d [trigger] [material or block id]' per line, from the bottom center, up to 16. trigger boxes only sense overlap.
  • Collisions with world blocks use the real block shape: slabs, stairs, snow layers, farmland, dirt paths, beds, chests, fences and walls (1.5 blocks tall), fence gates, doors, trapdoors, iron bars, glass panes and more.
  • Impact sound: collisions above 2 blocks per second play a material sound, louder when faster, at most once per 4 ticks. Only on bodies with the Impact & break component (Sound field).
  • Water and lava: lift by how submerged the body is (buoyancy 1 floats half out, 0 sinks) plus drag (lava is stickier).
  • Breaking: the Impact & break component fields Breakable, Hits (default 3) and Drop item. The server checks hits with a 4.5-block ray from the eyes; the count resets after 3 seconds without a hit.

Auto physics

The Rigidbody field Auto physics (on by default) computes mass, friction, bounce, center of mass and inertia from the boxes and blocks the body is made of. The Inspector shows the computed values greyed out; turning it off starts manual entry from those values. The server and the editor read the same block table (crux-physics.json).

ValueFormula
MassΣ box volume × density × shape fill (a player = 3)
Friction (0–1)1.5 × (1 − block slipperiness), volume-weighted. Slipperiness is the vanilla block value (normal 0.6 → 0.6, ice 0.98 → 0.03)
Bounce (0–1)Volume-weighted (slime block 0.8, most others 0)
Center of massMass-weighted average of box centers. Turn off Auto center of mass to enter x y z
InertiaPer box a solid cuboid (m/12 · (b² + c²)) plus the parallel-axis shift. Turn off Auto inertia to enter per-axis values
Block (examples)DensityFrictionBounce
Oak planks10.60
Stone40.60
Ice1.50.030
Slime block1.80.30.8
Iron block130.60
Gold block320.60
  • A box's block: the block id on the collider line, else the look's block, else the child look. Item looks have density 1.
  • Choosing a material (ice, rubber, slime, wood, metal) overrides friction and bounce with the material values.
  • New materials: material lines in the server object's Physics settings (one 'name friction bounce' per line). They appear in the Rigidbody material list, override a built-in material of the same name and work as the material name at the end of a collider box line.
MaterialFrictionBounce
Ice0.020.05
Rubber0.80.85
Slime0.50.95
Wood0.50.2
Metal0.30.1

Contacts, friction and bounce

  • Touching bodies solve their impulses together per island (10 velocity and 2 position iterations per step, set in Physics settings, warm-started), so stacks, bodies resting on others and pushed rows settle at once without jitter. Large islands are split across worker threads.
  • Friction between two bodies (or a body and a floor block) follows Friction combine in Physics settings: geometric mean √(friction a × friction b) by default, or average, minimum, maximum or product. One combine rule per world, not per material. Coulomb friction (slides once the push exceeds normal force × friction). A body on top of a moving body is carried by friction, so slippery ones slide.
  • Floor block friction: normal 0.6, ice 0.02, packed ice 0.015, blue ice 0.005, slime 0.6 (bounce 0.9), honey 1.5, soul sand 1.0. Example: a body with friction 0.6 on ice = √(0.6 × 0.02) ≈ 0.11.
  • Bounce follows Bounce combine in Physics settings (the larger of the two by default, so a slime floor bounces), only above a minimum approach speed, so resting bodies do not keep bouncing. No friction or bounce while a player pushes.
  • A body whose center of mass is past its support falls off (multi-box bodies included).
  • Collision detection (Rigidbody field): auto (default — continuous only for bodies thinner than 0.25 blocks), discrete (position per step, cheapest — may sink in briefly on impact) or continuous (sweeps the path while moving fast, so thin walls are not skipped).
  • Collision boxes are 1 cm narrower than the look on each horizontal side, so a 1-block body fits a 1-block hole or groove. Resting bodies may stay sunk in by the penetration slop (2 cm by default); top faces are raised by that much so bodies look flush on the floor.
  • Rotational dynamics by default — tilted-box contacts, tipping over edges, tumbling down stairs, dominoes. Engine: Jolt Physics (MIT) on a dedicated physics thread inside the server (the main thread only applies results and hands over input, one tick behind).
  • World blocks = static terrain — only exposed faces per 16-block section (full-block faces merged into large rectangles), keeping real block shapes (slabs, stairs, fences …) and floor materials (ice, slime …). Only changed sections are rebuilt.
  • Supported servers: Windows x64, Linux x64 (Ubuntu 22.04+, Debian 12+), Linux ARM64 (Ubuntu 24.04+, Debian 13+). Other Linux, Alpine and macOS: the server runs, rotational physics falls back to basic physics (axis-aligned boxes).

Physics settings (project)

One Physics settings component on the server object sets world-wide values. Without it the defaults apply.

FieldDefaultMeaning
Gravity32blocks/s² (Minecraft 0.08 blocks/tick²)
Friction · bounce combineGeometric mean · maximumHow two frictions or bounces mix
Physics materials—name friction bounce per line
Velocity · position iterations10 · 2Contact solver passes per step — more is stiffer and costlier
Sleep speed · time before sleep0.15 blocks/s · 0.5 sA touching group sleeps after staying below this speed this long
Penetration slop · speculative contact distance0.02 · 0.02 blocksJolt defaults
No collision—tag tag per line

Pushing and standing

  • The Rigidbody field Collide with players and entities (on by default) blocks, gets pushed and can be stood on. Turn it off for decoration.
  • Pushing is a force: while touching a body and holding a movement key, a player applies player mass × 0.025 × Push force (field, default 1) per tick. Top speed = walking speed (about 4.3 blocks/s) × Top push speed (field, default 1) × player mass ÷ (player mass + body mass × 0.5), so heavy bodies move slowly. Floor friction while pushed = usual × the field value (default 0 = slides).
  • Bodies lined up in front get pushed along (up to 8). Pushing on a corner makes the body slide aside.
  • Mobs and NPCs push by bumping, without movement keys. A fast body hitting a player knocks them back and fires a collision event.

Freeze physics

  • Hierarchy right-click → Freeze physics (with children) — the object and all its descendants are held in place (like kinematic; other bodies collide with them). The server keeps running.
  • Use it to edit fixed structures or arrange a scene on a running server. Unfreezing from the same menu wakes the bodies and they carry on.

Joints

TypeBehaviour
RopeKeeps a maximum length only (slack allowed) — hanging lamps, swings
RodAlways the same length
SpringPulls by the stretch, with stiffness and damping
FixedMoves together as one piece
HingeRotates only around the axis at the anchor, limits in degrees — doors, bridges, wheels
SliderSlides only along the axis without turning, limits in blocks — drawers, lifts
  • Target is another rigidbody object id; empty means a fixed point where it started. Length -1 means the starting distance. Never through blocks (if one side is blocked the other side makes up the difference).
  • Anchor = x y z from the body center (turns with the body, empty = center); target anchor = from the target center (or from the fixed point). Axis = direction in the body frame (hinge, slider). Limits start at 0 in the starting pose; 0 and 0 = none.
  • Break force = the force the joint holds (mass × blocks/s², a mass 1 body weighs 32). Above it the joint breaks; it reconnects when the fields change or the scene restarts. Rope, rod and spring for now. Sleeping bodies carry no load until something wakes them.
  • Hinge, slider, anchors and break force need rotational physics (Jolt).

Server authority, latency and security

  • Physics runs in exactly one place: the server. The editor only draws the positions the server sends every 2 ticks and clients only interpolate, so results never differ between people.
  • Clients only receive results, so a modified client cannot change a body's position or velocity. Player pushes are judged by the server from movement-key input and server-side positions.
  • Visible delay ≈ waiting for the tick (0–50 ms) + half the ping + the interpolation interval (50 ms × 1, 2 or 4). A body pushed by a player shows after the full ping + 50–100 ms.
  • No prediction — a little later, but everyone sees the same position.

Performance and measurements

  • Only objects with a Rigidbody are simulated. A supported body that barely moves for a second sleeps — but stays awake while a touching body is still moving, so a stack falls asleep together. It wakes on force, impact or losing its support.
  • Physics runs on its own thread — 4 steps per tick (1/80 s, the interval at which stacks stand under Minecraft gravity). If a step is not done by the next tick only that tick is skipped (slower only then). A touching pile sleeps as a whole once it stops.
  • Pose sending: only bodies that moved more than 0.01 blocks or 0.5° since the last send. Under heavy motion the nearest 128 every tick, the next 128 every 2 ticks, the rest every 4 (client interpolation). With basic physics the budget is 4 ms per tick (2 ms below 4 cores), far bodies at 10 or 5 Hz.
  • Only moved bodies are sent; rotation and scale changes are batched per interpolation interval (1.20.2+). Blocking shulkers exist only for bodies with a player within 48 blocks.
Test (26.3 Paper, 2026-11-05, 12-core PC)Result
1,000 bodies burst at once — until all stopabout 7.6 s, 0 awake at the end, 0 overlaps, 0 stuck in mid-air
Same test — main-thread physics time, p95about 5 ms (Jolt share about 2.5 ms, pose sending about 0.9 ms)
Same test — physics-thread step, p95about 15 ms (within the 50 ms tick)
Same test — network per viewerabout 62 KB/s
Same test — basic physics (same session)about 12 s, p95 about 6 ms, about 37 KB/s, 23 stuck in mid-air

Method: the server check tool with --bench 1000 --burst throws 1,000 bodies outward from one spot until all sleep. Network = entity moves × estimated packet size plus shape changes.

crux-docs · client 0.3.25 · plugin 1.4.0 · mc 26.3 · updated 2026-10-11 · report a mistake