Molang

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.

MolangWhat it doesSince
query.debug_output(arg1, arg2...)Output message to chatOnly works in animation debug mode1.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 tags2.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 tags2.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 81.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 81.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 offhand1.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 offhand1.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 offhand1.2.0
query.position(value)Returns the entity's position coordinates (accurate to 14 decimal places).0: X coordinate1: Y coordinate2: Z coordinate1.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 coordinate1.2.0
query.max_durability(slotType)Returns the maximum durability of the item in the specified slot.slotType parameters: chest feet head legs mainhand offhand2.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 offhand2.2.1
query.actor_countReturns the number of entities within the loaded range.1.1.5
query.anim_timeCurrent 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_timeHow 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_finishedAll animations in the current controller have finished playing.Can only be used inside an animation controller.2.3.0
query.any_animation_finishedAny animation in the current controller has finished playing.Can only be used inside an animation controller.2.3.0
query.head_x_rotationReturns the player's head X rotation angle; defaults to 0.1.1.5
query.head_y_rotationReturns the player's head Y rotation angle; defaults to 0.1.1.5
query.moon_phaseReturns the current moon phase (0-7).1.1.5
query.time_of_dayReturns the time of day.Midnight = 0, Sunrise = 0.25 Noon = 0.5, Sunset = 0.751.1.5
query.time_stampReturns the timestamp of the current world.1.1.5
query.yaw_speedReturns the entity's Y-axis rotation speed.1.1.5
query.cardinal_facing_2dReturns the player's facing direction.Ignores vertical pitch. North = 2.0, South = 3.0, West = 4.0, East = 5.01.1.5
query.distance_from_cameraReturns the distance between the player and the camera.1.1.5
query.eye_target_x_rotationReturns the player's view X rotation angle; defaults to 0.1.1.5
query.eye_target_y_rotationReturns 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_movedTotal horizontal distance moved by the player (meters).1.1.5
query.vertical_speedReturns 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_distanceReturns the total walking distance moved by the player (meters).1.1.5
query.has_ridertrue if the player is being ridden, otherwise false.1.1.5
query.is_first_persontrue if the player is in first-person view, otherwise false.1.1.5
query.is_in_watertrue if the player is in water, otherwise false.1.1.5
query.is_in_water_or_raintrue if the player is in water or rain, otherwise false.1.1.5
query.is_on_firetrue if the player is on fire, otherwise false.1.1.5
query.is_on_groundtrue if the player is on the ground, otherwise false.1.1.5
query.is_ridingtrue if the player is riding, otherwise false.1.1.5
query.is_sneakingtrue if the player is sneaking, otherwise false.1.1.5
query.is_spectatortrue if the player is in Spectator mode, otherwise false.1.1.5
query.is_sprintingtrue if the player is sprinting, otherwise false.1.1.5
query.is_swimmingtrue if the player is swimming, otherwise false.1.1.5
query.body_x_rotationReturns the player's body X rotation angle; defaults to 0.1.1.5
query.body_y_rotationReturns the player's body Y rotation angle; defaults to 0.1.1.5
query.healthReturns the player's health.1.1.5
query.max_healthReturns the player's maximum health.1.1.5
query.hurt_timePlayer's hurt timer; defaults to 0.1.1.5
query.is_eatingtrue if the player is eating, otherwise false.1.1.5
query.is_playing_deadtrue if the player is dying, otherwise false.1.1.5
query.is_sleepingtrue if the player is sleeping, otherwise false.1.1.5
query.is_using_itemtrue if the player is using an item, otherwise false.1.1.5
query.item_in_use_durationCounts up from 0 to the item's max use duration (in seconds). Defaults to 0.1.1.5
query.item_max_use_durationMax use duration of the item being used (in seconds). Defaults to 0.1.1.5
query.item_remaining<br>_use_durationRemaining use duration of the item being used (in seconds). Defaults to 0.1.1.5
query.equipment_countReturns the number of equipped armor pieces (0-4), excluding held items.Integer, varies with armor count, max 4.1.1.5
query.has_capetrue if the player has a cape, otherwise false.1.1.5
query.cape_flap_amountReturns 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_levelReturns the player's experience level.1.1.5
query.is_jumpingtrue 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 yaw2.6.0