Repository navigation
Supported Molang queries
BetterModel provides two queries resolved during keyframe compilation and 98 query names evaluated at runtime, including aliases. The runtime queries are available on Bukkit NMS v1_21_R3 through v1_21_R7, v26_R1 through v26_R3, and Fabric.
Use these queries as values in keyframe expressions, for example query.anim_time * 20. BetterModel resolves both names to the keyframe's timestamp in seconds when it compiles the expression. They do not require an entity.
| Query | Arguments | Description | Applicable entities |
|---|---|---|---|
query.anim_time |
None | The keyframe's time in the animation, in seconds. | No entity required |
query.life_time |
None | Alias for query.anim_time in BetterModel keyframe expressions. |
No entity required |
-
query.andq.are interchangeable. For example,query.ground_speed()andq.ground_speed()return the same value. -
None in the Arguments column means the query takes no arguments, as in
q.is_on_ground(). - Runtime queries read Minecraft Java Edition server state when evaluated. Conditions return
1when true and0when false. A common query returns0if the entity type does not apply, exceptquery.model_scale, which defaults to1. - All entities means any entity tracked by BetterModel. Players can use both the common queries and the player-only queries.
| Query | Arguments | Description | Applicable entities |
|---|---|---|---|
query.position |
axis |
World coordinate along the selected axis, in blocks. | All entities |
query.position_delta |
axis |
Server-reported movement along the selected axis, in blocks per tick. | All entities |
query.movement_direction |
axis |
Component of the normalized movement vector along the selected axis. Returns 0 when stationary. |
All entities |
query.ground_speed |
None | Horizontal speed in the XZ plane, in blocks per second. | All entities |
query.vertical_speed |
None | Signed speed along the Y axis, in blocks per second. Positive values indicate upward movement. | All entities |
query.is_moving |
None | The server reports nonzero movement in three dimensions. | All entities |
query.is_on_ground |
None | The entity is on the ground. | All entities |
query.has_collision |
None | The entity's no-physics flag is off. | All entities |
query.has_gravity |
None | The entity's effective gravity is nonzero. | All entities |
query.is_in_water |
None | The entity is in water. | All entities |
query.is_in_lava |
None | The entity is in lava. | All entities |
query.is_in_water_or_rain |
None | The entity is in water or exposed to rain. | All entities |
query.head_is_in_water |
None | The entity's eyes are underwater. | All entities |
query.is_swimming |
None | The entity is in the swimming state. | All entities |
query.is_crawling |
None | Java Edition marks the entity as visually crawling. | All entities |
query.is_sneaking |
None | The entity's sneak flag is set. | All entities |
query.is_sprinting |
None | The entity is sprinting. | All entities |
query.is_jumping |
None | The latest player input reports jump, or the server jump flag is set for another living entity. | Living entities |
query.is_wall_climbing |
None | The spider's wall-climbing flag is set. | Spiders and cave spiders |
query.is_gliding |
None | The entity is gliding with elytra. | Living entities |
query.is_levitating |
None | The Levitation effect is active. | Living entities |
For axis, use 0 for X, 1 for Y, or 2 for Z. Other values return 0. For example, q.position(1) gives the entity's world height. Speed conversions use 20 ticks per second.
| Query | Arguments | Description | Applicable entities |
|---|---|---|---|
query.body_y_rotation |
None | Body yaw in degrees, from -180 inclusive to 180 exclusive. Uses entity yaw for nonliving entities. |
All entities |
query.head_x_rotation |
head_index |
Pitch of the selected head, in degrees. | Living entities. Only withers have extra head indices. |
query.head_y_rotation |
head_index |
Negated server yaw of the selected head, in degrees, from -180 inclusive to 180 exclusive. |
Living entities except horse-type mobs. Only withers have extra head indices. |
query.is_riding |
None | The entity is riding another entity. | All entities |
query.has_rider |
None | The entity has at least one direct passenger. | All entities |
query.has_player_rider |
None | At least one direct passenger is a player. | All entities |
query.ride_body_y_rotation |
None | The current vehicle's body yaw, in degrees, using the same rules as query.body_y_rotation. Returns 0 when there is no vehicle. |
All entities |
query.rider_body_y_rotation |
rider_index |
The selected passenger's body yaw, in degrees, using the same rules as query.body_y_rotation. |
All entities |
query.rider_head_x_rotation |
rider_index |
The selected passenger's pitch, in degrees. | Entities with a living passenger |
query.rider_head_y_rotation |
rider_index |
The selected passenger's server head yaw, in degrees, from -180 inclusive to 180 exclusive. |
Entities with a living passenger other than a horse-type mob |
- Use
head_index = 0for the main head. Withers also accept1and2for their side heads. -
rider_indexstarts at0and follows the server's direct passenger list. For example,q.rider_head_x_rotation(0)reads the first passenger's pitch. - Invalid indices return
0. Horse-type mobs are members of Java Edition'sAbstractHorsefamily, including horses, donkeys, mules, and camels.
| Query | Arguments | Description | Applicable entities |
|---|---|---|---|
query.is_alive |
None | The entity is alive. | All entities |
query.is_invisible |
None | The entity is invisible. | All entities |
query.is_silent |
None | The entity's silent flag is set. | All entities |
query.is_on_fire |
None | The entity is on fire. | All entities |
query.is_onfire |
None | Alias for query.is_on_fire. |
All entities |
query.is_fire_immune |
None | The entity is immune to fire. | All entities |
query.is_leashed |
None | A leash is attached to the entity. | Leashable entities |
query.is_baby |
None | The entity is a baby. | Living entities |
query.is_in_love |
None | The animal is ready to breed. | Animals |
query.is_sleeping |
None | The entity is sleeping. | Living entities |
query.is_sitting |
None | The entity is sitting. See the platform details below. | Varies by platform |
query.is_tamed |
None | The entity is tamed. | Tameable animals and horse-type mobs |
query.has_owner |
None | The entity has an owner recorded. | Tameable animals and horse-type mobs |
query.is_chested |
None | The entity has a chest equipped. | Donkeys, mules, llamas, and other mobs that can carry a chest |
query.is_saddled |
None | The mob has a saddle equipped. | Saddleable mobs |
query.has_target |
None | The mob's AI has a target. | Mobs |
query.blocking |
None | The entity is blocking with an item. | Living entities |
query.is_using_item |
None | The entity is actively using an item. | Living entities |
query.has_head_gear |
None | The head equipment slot contains an item. | Living entities |
query.equipment_count |
None | Number of occupied armor slots. | Living entities |
query.health |
None | Current health, in health points. | Living entities |
query.max_health |
None | Maximum health, in health points. | Living entities |
query.death_ticks |
None | Server counter for death progression, in ticks. | Living entities |
query.hurt_time |
None | Time remaining in the server's hurt animation counter, in ticks. | Living entities |
query.item_in_use_duration |
None | Time spent using the current item, in seconds. | Living entities |
query.model_scale |
None | Server-side entity scale multiplier. | Living entities |
On Bukkit, query.is_sitting reads the Sittable state. On Fabric, it reads the sitting pose for tameable animals and camels, or the sitting state for foxes and pandas.
| Query | Arguments | Description | Applicable entities |
|---|---|---|---|
query.is_charged |
None | The creeper is charged. | Creepers |
query.is_ignited |
None | The creeper's ignition flag is set. | Creepers |
query.is_sheared |
None | The sheep has been sheared or the snow golem's pumpkin has been removed. | Sheep and snow golems |
query.is_carrying_block |
None | The enderman is carrying a block. | Endermen |
query.is_casting |
None | The illager is casting a spell. | Spellcasting illagers |
query.is_elder |
None | The entity is an elder guardian. | Elder guardians |
query.is_dancing |
None | The allay is dancing. | Allays |
query.is_playing_dead |
None | The axolotl is playing dead. | Axolotls |
query.is_resting |
None | The bat is resting. | Bats |
query.is_bribed |
None | The dolphin has been fed a fish. | Dolphins |
query.is_eating |
None | The panda is eating. | Pandas |
query.is_rolling |
None | The panda is rolling. | Pandas |
query.is_sneezing |
None | The panda is sneezing. | Pandas |
query.is_interested |
None | The server's interested flag is set. | Foxes and wolves |
query.is_illager_captain |
None | The illager is marked as a patrol leader. | Illagers |
query.is_stunned |
None | The ravager's stun timer is above zero. | Ravagers |
query.is_shield_powered |
None | The wither's armor is active. | Withers |
query.is_transforming |
None | The zombie is undergoing underwater conversion. | Zombie-type mobs |
query.is_pregnant |
None | The turtle carries an egg, or the frog is ready to lay spawn. | Turtles and frogs |
query.is_laying_egg |
None | The turtle is laying an egg. | Turtles |
query.is_croaking |
None | The frog is in the croaking pose. | Frogs |
query.is_sniffing |
None | The mob is sniffing. | Sniffers and wardens |
query.is_digging |
None | The mob is in the digging state. | Sniffers and wardens |
query.is_searching |
None | The sniffer is in the searching state. | Sniffers |
query.is_emerging |
None | The warden is emerging from the ground. | Wardens |
query.is_roaring |
None | The ravager's roar timer is above zero or the warden is in the roaring pose. | Ravagers and wardens |
query.is_ram_attacking |
None | The goat's AI has a ram target recorded. | Goats |
query.current_squish_value |
None | Raw squish animation value for the current tick. | Slimes and magma cubes |
query.previous_squish_value |
None | Raw squish animation value from the previous tick. | Slimes and magma cubes |
query.swell_amount |
None | Java Edition's swelling animation value as the creeper approaches detonation. | Creepers |
query.swelling_dir |
None | Server swelling direction. Positive means swelling, and negative means deflating. | Creepers |
query.head_roll_angle |
None | Sideways head tilt, in degrees. | Wolves |
query.tail_angle |
None | Tail angle, in degrees. | Wolves |
query.sit_amount |
None | Progress of the sitting animation. | Pandas |
query.lie_amount |
None | Progress of the animation for lying on the back. | Pandas |
query.roll_counter |
None | Server counter for the rolling animation, in ticks. | Pandas |
| Query | Arguments | Description | Applicable entities |
|---|---|---|---|
query.is_spectator |
None | The player is in Spectator mode. | Players |
query.player_level |
None | Current experience level. | Players |
query.cardinal_facing |
None | Closest of the six directions to the player's view. | Players |
query.cardinal_player_facing |
None | Alias for query.cardinal_facing. |
Players |
query.cardinal_facing_2d |
None | Closest horizontal direction to the player's view. Uses codes 2 through 5. |
Players |
Direction codes are down 0, up 1, north 2, south 3, west 4, and east 5.