YSM Molang reference: Query (q.)
Every Molang function and variable you can use in Yes Steve Model animations and controllers, with what it returns and the YSM version that added it. New to Molang? Start with Molang in YSM.
- All 280
- Math functions 33
- Query (q.) 60
- YSM player & entity 105
- YSM projectiles 9
- Controller (ctrl.) 25
- Script controller 5
- TaCZ guns 9
- Immersive Melodies 5
- Touhou Little Maid 16
- Curios accessories 4
- Other mods 9
| Molang | What it does | Since |
|---|---|---|
| query.debug_output(arg1, arg2...) | Output message to chatOnly works in animation debug mode | 1.2.0 |
| query.biome_has_all_tags(tag1, tag2...) | Check if the player's current biome has all specified biome tagsOnly available in 1.18+ (1.16 lacks biome tags); Use the locate command to check current biome tags | 2.2.1 |
| query.biome_has_any_tag(tag1, tag2...) | Check if the player's current biome has any of the specified biome tagsOnly available in 1.18+ (1.16 lacks biome tags);Use the locate command to check current biome tags | 2.2.1 |
| query.relative_block_has_all_tags<br>(xOffset, yOffset, zOffset, tag1, tag2...) | Check if a block near the player has all specified block tagsThe first three parameters are centered on the player's lower body; max offset is 8 | 1.2.0 |
| query.relative_block_has_any_tag<br>(xOffset, yOffset, zOffset, tag1, tag2...) | Check if a block near the player has any of the specified block tagsThe first three parameters are centered on the player's lower body; max offset is 8 | 1.2.0 |
| query.is_item_name_any<br>(slotType, id1, id2...) | Check if the player's equipped item ID matches any of the specified IDsslotType values: chest feet head legs mainhand offhand | 1.2.0 |
| query.equipped_item_all_tags<br>(slotType, tag1, tag2...) | Check if the player's equipped item has all specified item tagsslotType values: chest feet head legs mainhand offhand | 1.2.0 |
| query.equipped_item_any_tag<br>(slotType, tag1, tag2...) | Checks if the player's equipped item contains any of the specified item tags.slotType parameters: chest feet head legs mainhand offhand | 1.2.0 |
| query.position(value) | Returns the entity's position coordinates (accurate to 14 decimal places).0: X coordinate1: Y coordinate2: Z coordinate | 1.2.0 |
| query.position_delta(value) | Returns the difference in the entity's position coordinates since the last animation update (frame rate dependent).0: X coordinate1: Y coordinate2: Z coordinate | 1.2.0 |
| query.max_durability(slotType) | Returns the maximum durability of the item in the specified slot.slotType parameters: chest feet head legs mainhand offhand | 2.2.1 |
| query.remaining_durability<br>(slotType) | Returns the remaining durability of the item in the specified slot.slotType parameters: chest feet head legs mainhand offhand | 2.2.1 |
| query.actor_count | Returns the number of entities within the loaded range. | 1.1.5 |
| query.anim_time | Current animation playback time (seconds), or 0 if not playing.Represents the animation timeline in seconds. For looping animations, it is the total playback duration with no limit. | 1.1.5 |
| query.life_time | How long the current animation has played (seconds), or 0 if not playing.Represents the animation's life time; the maximum value is the length of the current animation. | 1.1.5 |
| query.all_animations_finished | All animations in the current controller have finished playing.Can only be used inside an animation controller. | 2.3.0 |
| query.any_animation_finished | Any animation in the current controller has finished playing.Can only be used inside an animation controller. | 2.3.0 |
| query.head_x_rotation | Returns the player's head X rotation angle; defaults to 0. | 1.1.5 |
| query.head_y_rotation | Returns the player's head Y rotation angle; defaults to 0. | 1.1.5 |
| query.moon_phase | Returns the current moon phase (0-7). | 1.1.5 |
| query.time_of_day | Returns the time of day.Midnight = 0, Sunrise = 0.25 Noon = 0.5, Sunset = 0.75 | 1.1.5 |
| query.time_stamp | Returns the timestamp of the current world. | 1.1.5 |
| query.yaw_speed | Returns the entity's Y-axis rotation speed. | 1.1.5 |
| query.cardinal_facing_2d | Returns the player's facing direction.Ignores vertical pitch. North = 2.0, South = 3.0, West = 4.0, East = 5.0 | 1.1.5 |
| query.distance_from_camera | Returns the distance between the player and the camera. | 1.1.5 |
| query.eye_target_x_rotation | Returns the player's view X rotation angle; defaults to 0. | 1.1.5 |
| query.eye_target_y_rotation | Returns the player's view Y rotation angle; defaults to 0. | 1.1.5 |
| query.ground_speed [+client] | Returns the player's speed. Cannot be synced on the server; use ysm.ground_speed instead.Always non-negative (outputs a positive value even when moving backward, so it cannot distinguish movement direction). Walking is ~1.7, running is ~3.2, flying is 20. | 1.1.5 |
| query.modified_distance_moved | Total horizontal distance moved by the player (meters). | 1.1.5 |
| query.vertical_speed | Returns the player's vertical movement speed (m/s); upward is positive.Creative mode flight: [-7.5, 7.5] Falling from height: [0, 20] | 1.1.5 |
| query.walk_distance | Returns the total walking distance moved by the player (meters). | 1.1.5 |
| query.has_rider | true if the player is being ridden, otherwise false. | 1.1.5 |
| query.is_first_person | true if the player is in first-person view, otherwise false. | 1.1.5 |
| query.is_in_water | true if the player is in water, otherwise false. | 1.1.5 |
| query.is_in_water_or_rain | true if the player is in water or rain, otherwise false. | 1.1.5 |
| query.is_on_fire | true if the player is on fire, otherwise false. | 1.1.5 |
| query.is_on_ground | true if the player is on the ground, otherwise false. | 1.1.5 |
| query.is_riding | true if the player is riding, otherwise false. | 1.1.5 |
| query.is_sneaking | true if the player is sneaking, otherwise false. | 1.1.5 |
| query.is_spectator | true if the player is in Spectator mode, otherwise false. | 1.1.5 |
| query.is_sprinting | true if the player is sprinting, otherwise false. | 1.1.5 |
| query.is_swimming | true if the player is swimming, otherwise false. | 1.1.5 |
| query.body_x_rotation | Returns the player's body X rotation angle; defaults to 0. | 1.1.5 |
| query.body_y_rotation | Returns the player's body Y rotation angle; defaults to 0. | 1.1.5 |
| query.health | Returns the player's health. | 1.1.5 |
| query.max_health | Returns the player's maximum health. | 1.1.5 |
| query.hurt_time | Player's hurt timer; defaults to 0. | 1.1.5 |
| query.is_eating | true if the player is eating, otherwise false. | 1.1.5 |
| query.is_playing_dead | true if the player is dying, otherwise false. | 1.1.5 |
| query.is_sleeping | true if the player is sleeping, otherwise false. | 1.1.5 |
| query.is_using_item | true if the player is using an item, otherwise false. | 1.1.5 |
| query.item_in_use_duration | Counts up from 0 to the item's max use duration (in seconds). Defaults to 0. | 1.1.5 |
| query.item_max_use_duration | Max use duration of the item being used (in seconds). Defaults to 0. | 1.1.5 |
| query.item_remaining<br>_use_duration | Remaining use duration of the item being used (in seconds). Defaults to 0. | 1.1.5 |
| query.equipment_count | Returns the number of equipped armor pieces (0-4), excluding held items.Integer, varies with armor count, max 4. | 1.1.5 |
| query.has_cape | true if the player has a cape, otherwise false. | 1.1.5 |
| query.cape_flap_amount | Returns the cape flap amount. Works even if the player has no cape.0 is fully down, 1 is fully up. Returns weird data, not recommended. | 1.2.0 |
| query.player_level | Returns the player's experience level. | 1.1.5 |
| query.is_jumping | true if the player is jumping, otherwise false. | 1.1.5 |
| query.rotation_to_camera(args) | Returns the yaw and pitch of the player's camera view.args is 0 or 1. 0 for pitch 1 for yaw | 2.6.0 |