Guide · Molang

Molang Tips, Extra Queries, and Version Features in YSM

Yes Steve Model (YSM) extends standard Bedrock Molang with dozens of custom queries for checking equipment, weather, bones, Touhou Little Maid states, and Curios/Trinkets. This guide covers all extra YSM Molang variables and functions across versions 1.2.0 to 2.5.0, plus important Minecraft version compatibility warnings.

Minecraft Version Compatibility Warnings

Some preset Molang variables behave differently depending on the Minecraft version your players use. Always check version limits before relying on biome, step height, or parrot queries so your model does not break across different game versions.

The variable ysm.biome_category is only available in Minecraft 1.16.5 and 1.18.2. It returns a string representing the biome category the player is standing in. Possible return values are: taiga, extreme_hills, jungle, mesa, plains, savanna, icy, beach, forest, ocean, desert, river, swamp, mushroom, nether, and the_end.

For newer Minecraft versions, other queries have strict minimum version requirements: query.biome_has_all_tags and query.biome_has_any_tags only work in 1.18+ (they exist in 1.16 only as dummy placeholders for forward compatibility). Furthermore, ysm.step_height_addition requires 1.19+, and left_shoulder_parrot_variant / right_shoulder_parrot_variant require 1.20+ (note that the source docs also list a typo variant left_shoulder_parrot_varian).

// Only works in Minecraft 1.16.5 and 1.18.2
ysm.biome_category == 'forest'
If you want your model to work across 1.16.5 through 1.20+, avoid using biome category strings for critical animation logic.

Debugging, Math, and Mod Detection (Since 1.2.0)

When building complex animations, you need a way to inspect values inside the game. YSM provides chat debug output functions that only trigger when animation debug mode is enabled, returning null during normal gameplay.

You can print custom values with query.debug_output(), or dump specific game data to the chat box using ysm.dump_mods (installed mods), ysm.dump_equipped_item(slot), ysm.dump_relative_block(x, y, z), and ysm.dump_effects (active potion effects).

To adapt animations when other mods are present or to check the active skin, use ysm.mod_version(mod_id) to get a mod's version string (or null if missing) and ysm.texture_name to get the current texture file name including its extension. For angle math, math.min_angle(angle) normalizes any angle into the [-180, 180) range.

// Print values to chat in animation debug mode (displays: Meow123)
query.debug_output('Meow', 1, 2, 3)

// Normalize 780 degrees into [-180, 180) -> returns 60
math.min_angle(780)

// Check active texture name and installed mod version
ysm.texture_name == 'blue.png'
ysm.mod_version('tac')

Position, Environment, Blocks, and Weather (Since 1.2.0 & 2.5.0)

You can make models react to coordinates, movement speed, and surroundings. query.position(axis) returns the entity's X (0), Y (1), or Z (2) coordinate, while query.position_delta(axis) returns the frame-rate-dependent coordinate change since the last animation update.

For weather and dimension checks (since 1.2.0), ysm.dimension_name returns the dimension ID string, ysm.weather returns 0 (clear), 1 (rain/snow), or 2 (thunder/blizzard), and ysm.is_open_air returns true if the player has an unobstructed view of the sky. Unlike q.is_in_water_or_rain, combining ysm.weather and ysm.is_open_air lets you detect when a player is being snowed on.

To inspect blocks around the player, pass relative coordinates (x, y, z) centered on the player to ysm.relative_block_name(x, y, z), query.relative_block_has_all_tags(x, y, z, tags...), or query.relative_block_has_any_tag(x, y, z, tags...). Note that a bug with ysm.relative_block_name on Forge 1.20 was fixed in YSM 2.2.1. Since YSM 2.5.0, you can also check lighting at the block under the player's feet using ysm.block_light and ysm.sky_light.

// Get player Y coordinate
q.position(1)

// Calculate X speed across frames using position_delta
v.time0 > 0 && q.life_time - v.time0 > 0 ? (v.speed_x = (q.position_delta(0) - v.x0) / (q.life_time - v.time0));
v.x0 = q.position_delta(0);
v.time0 = q.life_time;
return v.speed_x;

// Check block directly beneath the player
ysm.relative_block_name(0, -1, 0) == 'minecraft:sand'
q.relative_block_has_all_tags(0, -0.5, 0, 'minecraft:sand', 'minecraft:enderman_holdable')

Equipment, Enchantments, Durability, and Effects (Since 1.2.0 & 2.2.1)

YSM lets you trigger custom animations based on what the player is holding or wearing. Slot names follow Bedrock Edition equipment slot conventions and are case-sensitive: Mainhand, Offhand, Feet, Legs, Chest, and Head.

Since 1.2.0, you can check item IDs with query.is_item_name_any(slot, ids...), check tags with query.equipped_item_all_tags(slot, tags...) and query.equipped_item_any_tag(slot, tags...), or query enchantment levels with ysm.equipped_enchantment_level(slot, enchantment_id) (returns 0 if unenchanted). You can also check active potion levels on a player or arrow with ysm.effect_level(effect_id).

Since 2.2.1, you can read item durability using q.max_durability(slot) and q.remaining_durability(slot). In 2.4.0, YSM also added ysm.mainhand_charged_crossbow, ysm.offhand_charged_crossbow, and ysm.is_fishing.

// Check item IDs and tags in Mainhand
q.is_item_name_any('Mainhand', 'cooked_beef')
query.equipped_item_all_tags('Mainhand', 'minecraft:tools', 'minecraft:swords')

// Get Mending level on Mainhand item (returns 0 if none)
ysm.equipped_enchantment_level('Mainhand', 'minecraft:mending')

// Check regeneration effect level and item durability
ysm.effect_level('minecraft:regeneration')
q.max_durability('Mainhand')
q.remaining_durability('Mainhand')

Projectiles, Arrows, and Fishing Hooks (1.2.0 to 2.5.0)

When animating custom arrows and projectiles, YSM provides dedicated state queries. Since 1.2.0, ysm.in_ground checks if an arrow is stuck in the ground, ysm.on_ground_time returns how many ticks it has lain there, ysm.is_spectral_arrow checks for spectral arrows, and ysm.delta_movement_length measures displacement between two ticks to determine speed.

Most importantly, ysm.projectile_owner returns the player entity who fired the arrow, allowing you to use the arrow operator (->) to query the shooter's attributes. By placing a null-coalescing assignment in the first frame of a parallel animation's command keyframe, you can snapshot the shooter's bow enchantments once when fired.

Later updates expanded projectile support: ysm.shoot_item_id (since 2.3.0) identifies which weapon fired the arrow, while 2.5.0 added ysm.throwable_item (item ID of thrown item projectiles), ysm.hooked_in (entity ID caught by a fishing hook), and ysm.is_biting (whether a fish is biting the hook).

// Store the shooter's Flame enchantment level once on arrow launch
v.flame_level ?? (v.flame_level = ysm.projectile_owner->ysm.equipped_enchantment_level('Mainhand', 'minecraft:flame'))
If ysm.delta_movement_length reports abnormal projectile speeds in your modpack, try installing the Fast Projectile Fix mod.

Player State, Attributes, Camera, and Physics (2.2.1 to 2.3.1)

Version 2.2.1 introduced extensive player status and entity attribute queries. You can check climbing with ysm.on_ladder (boolean) and ysm.ladder_facing (0=South, 1=West, 2=North, 3=East), shoulder parrots with has_left_shoulder_parrot and has_right_shoulder_parrot, cape physics with query.cape_flap_amount (0 to 1, works even without a cape since 1.2.0), and environmental states like ysm.eye_in_water, ysm.frozen_ticks (up to 140 in powder snow), ysm.air_supply (max 300), ysm.arrow_count, and ysm.stinger_count.

You can also directly read entity attributes since 2.2.1: ysm.attack_damage, ysm.attack_speed, ysm.attack_knockback, ysm.movement_speed, ysm.knockback_resistance, ysm.luck, ysm.block_reach, ysm.entity_reach, ysm.swim_speed, ysm.entity_gravity, ysm.nametag_distance, and ysm.step_height_addition (1.19+ only).

For UI and camera views, ysm.rendering_in_inventory (2.2.1, fixed in 2.3.1) and ysm.rendering_in_paperdoll (2.3.1) detect GUI rendering, while ysm.person_view (2.3.1) returns 0 for first-person, 1 for third-person back, and 2 for third-person front. Version 2.2.2 added previous-frame bone queries: ysm.bone_pivot_abs('BoneName').x/y/z and ysm.bone_rot / ysm.bone_scale / ysm.bone_pos. Version 2.3.0 added movement input queries (ysm.input_vertical, ysm.input_horizontal), physics smoothing functions (ysm.first_order, ysm.second_order), and controller queries (q.any_animation_finished, q.all_animations_finished, and ctrl.* variables like ctrl.idle, ctrl.run, ctrl.walk, ctrl.climb).

// Read previous frame bone pivot in model space and bone rotation (Since 2.2.2)
ysm.bone_pivot_abs('LeftHand').x
ysm.bone_rot('LeftLeg').x
If a parent bone is hidden or scaled to 0, ysm.bone_pivot_abs will stop updating its value.

Touhou Little Maid (TLM) and Particles (Since 2.4.0)

Since version 2.4.0, YSM includes built-in queries to distinguish between players and maids and to read Touhou Little Maid (TLM) states. Use ysm.entity_type ('player' or 'maid'), ysm.is_player, and ysm.is_maid to check who is wearing the model.

When worn by a maid, you can query tlm.favorability_point (0-384), tlm.favorability_level (0-3), tlm.task_id (string), tlm.schedule ('day', 'night', 'all'), and tlm.activity ('work', 'idle', 'reset'). You can also check board game stats (tlm.gomoku_win_count, tlm.gomoku_rank from 1-4, tlm.game_statue as 'win', 'lost', or empty string), equipment (tlm.backpack_type, tlm.show_item), and render type (tlm.is_entity, tlm.is_statue, tlm.is_garage_kit).

Version 2.4.0 also added Molang functions to spawn particles directly from animations: ysm.particle and ysm.abs_particle.

// Spawn particles (relative or absolute)
ysm.particle('id', x, y, z, dx, dy, dz, speed, count, life_time)
ysm.abs_particle('id', x, y, z, dx, dy, dz, speed, count, life_time)

Curios/Trinkets, Audio, Input, and Script Controllers (Since 2.5.0)

YSM 2.5.0 added accessory mod integration. On Forge/NeoForge this queries Curios, and on Fabric it queries Trinkets. Because slot type names differ between Curios and Trinkets, you must adapt slot types separately for each mod loader. Use ysm.has_any_curios(type, name...), ysm.has_any_curios_with_all_tags(type, tag...), and ysm.has_any_curios_with_any_tag(type, tag...) (passing 0 names to ysm.has_any_curios simply checks if the slot is non-empty), or inspect worn accessories in debug mode with ysm.dump_curios.

You can also play and stop sounds directly from Molang using ysm.play_sound('id', 'sound_name', boolean, volume, pitch) (where boolean controls forced playback) and ysm.stop_sound('id'). To detect live hardware input, use ysm.mouse(keycode) and ysm.keyboard(keycode).

Finally, 2.5.0 introduced functions exclusively for script controllers: ctrl.set_animation(animation, loop_type) to play a specific animation and ctrl.set_beginning_transition_length(second) to set the animation blend time for the current controller.

// Play and stop an audio track by custom identifier
ysm.play_sound('id', 'sound_name', boolean, volume, pitch)
ysm.stop_sound('id')

// Script controller exclusive functions
ctrl.set_animation(animation, loop_type)
ctrl.set_beginning_transition_length(second)

Questions

Why does ysm.biome_category not work in Minecraft 1.20?

ysm.biome_category is only supported in Minecraft 1.16.5 and 1.18.2. In 1.18 and above, Minecraft uses biome tags instead, so you should use query.biome_has_all_tags or query.biome_has_any_tags.

How do I check if a player is standing in snow?

Standard q.is_in_water_or_rain does not detect snow. Instead, check if ysm.weather > 0 (1 for rain/snow, 2 for thunder/blizzard) AND ysm.is_open_air is true, combined with cold biome or altitude checks.

Why isn't query.debug_output() or ysm.dump_equipped_item() printing anything in chat?

All debug output and dump functions (query.debug_output, ysm.dump_mods, ysm.dump_equipped_item, ysm.dump_relative_block, ysm.dump_effects, ysm.dump_curios) only work when YSM's animation debug mode is turned on.

Do Curios queries work on both Forge and Fabric?

Yes, since YSM 2.5.0, ysm.has_any_curios and its tag variants support Curios on Forge/NeoForge and Trinkets on Fabric. However, because Curios and Trinkets use different slot type names, you need to check both slot types if you want cross-loader compatibility.

Next: Molang Variables in YSM: Complete Beginner Guide →

More in Molang