Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ryanhcode/sable/llms.txt
Use this file to discover all available pages before exploring further.
EntitySubLevelUtil provides utilities for working with entities in relation to sub-levels: kicking entities out of sub-levels, checking whether an entity should be kicked, and reading tracking state. All methods are static; the class is not intended to be instantiated.
kickEntity
AbstractHurtingProjectile instances with zero accelerationPower, the global velocity at the entity’s position is also added to the delta movement (converted from m/s to m/t).
FallingBlockEntity receives special treatment: the transform is applied relative to the block’s vertical centre rather than its feet, preventing a visual offset on ejection.
The sub-level the entity is currently tracked inside and being ejected from.
The entity to relocate to global space.
shouldKick
true if the entity’s type does not have the #sable:retain_in_sub_level entity type tag. Entities without this tag are candidates for ejection when a sub-level is removed or when the engine determines they should not remain inside.
The entity to check.
To make a custom entity remain inside a sub-level after removal, add its entity type to the
sable:retain_in_sub_level tag in your mod’s data pack.setOldPosNoMovement
xOld, xo, yOld, yo, zOld, zo) so that the renderer interpolates zero movement for the current tick. This accounts for any tracking sub-level interpolation that may have shifted the entity’s apparent position, making teleportation appear instantaneous rather than as a visual jump.
Call this immediately after repositioning an entity (for example, after kickEntity) when you do not want the engine’s default position interpolation to apply.
The entity whose previous-position fields should be updated.
getCustomEntityOrientation
null to fall back to the default orientation. The default implementation always returns null and is intended as an extension point for override by platform-specific code or future additions.
The entity to query.
The render partial tick value for interpolation.
hasCustomEntityOrientation
true if getCustomEntityOrientation() will return a non-null value for this entity. The default implementation always returns false. Check this before calling the heavier getCustomEntityOrientation() in a render loop.
The entity to check.
SubLevelHelper — wind and air-velocity utilities
SubLevelHelper is a companion class that exposes two static methods relevant to aerodynamic and propulsion force calculations in sub-level physics.
registerWindProvider
getVelocityRelativeToAir() to compute the net wind at any point.
Use this to integrate custom weather, fan blocks, or atmospheric systems with Sable’s aerodynamic simulation. Wind velocity is expressed in metres per second.
A function that accepts a world position and the level, and returns the air velocity vector at that point in m/s. May return
null to indicate no contribution at that position.getVelocityRelativeToAir
pos is subtracted from the raw velocity. The result is written into dest and also returned.
This value is used internally for propeller and aerodynamic drag force calculations.
The level containing the point.
The world position to evaluate, in metres.
Destination vector that receives the result. Also returned by the method.
dest populated with the velocity relative to air in m/s.
