Guide · Molang

Common Molang Snippets and Tricks for YSM Models

Molang expressions let your Yes Steve Model (YSM) react dynamically to in-game player states without complex keyframe animations. This guide covers ready-to-use Molang snippets for Blockbench debugging, armor-based outfit toggling, eye tracking, automatic blinking, and glowing bone groups.

Testing Molang in Blockbench with Variable Placeholders

Testing your Molang expressions directly inside Minecraft takes a lot of time. Blockbench includes a Variable Placeholders panel that lets you create interactive sliders and toggle buttons to preview YSM queries right in the animation editor.

Using slider('Label') creates a numeric slider for continuous values like speed or camera angles, while toggle('Label') creates an on/off switch for boolean states like wearing armor or blinking.

Paste the following preset list into your Blockbench Variable Placeholders box to quickly simulate common YSM and Minecraft queries:

query.ground_speed = slider('Ground Speed')
query.vertical_speed = slider('Vertical Speed')
ysm.head_yaw = slider('Head Yaw (Left/Right)')
ysm.head_pitch = slider('Head Pitch (Up/Down)')
query.health = slider('Current Health')
query.max_health = slider('Max Health')
ysm.food_level = slider('Food Level')
query.player_level = slider('Player Level')
query.time_of_day = slider('Time of Day')
query.moon_phase = slider('Moon Phase')
ysm.armor_value = slider('Armor Value')
query.distance_from_camera = slider('Camera Distance')
ysm.has_chest_plate = toggle('Chestplate')
ysm.has_leggings = toggle('Leggings')
ysm.has_helmet = toggle('Helmet')
ysm.has_boots = toggle('Boots')
ysm.has_elytra = toggle('Elytra')
ysm.is_close_eyes = toggle('Close Eyes / Blink')
ysm.has_mainhand = toggle('Mainhand Item')
ysm.has_offhand = toggle('Offhand Item')
query.is_on_fire = toggle('On Fire')
query.is_in_water_or_rain = toggle('In Water or Rain')
query.is_spectator = toggle('Spectator Mode')
query.is_first_person = toggle('First Person')
query.is_jumping = toggle('Jumping')
query.is_on_ground = toggle('On Ground')
You can rename the English labels inside the single quotes to whatever you prefer; only the query name on the left side of the equals sign must remain exact.

Outfit Switching via Armor Slots

A popular feature in YSM models is changing clothes or showing custom armor pieces when the player equips armor in-game. You can toggle clothing visibility by binding a bone's Scale keyframe to YSM armor queries inside a parallel animation.

When the player equips an armor piece, the query returns 1 (normal size). When unequipped, it returns 0 (shrunk to invisibility). Apply these queries to all three Scale axes (X, Y, Z) of your clothing or armor bone group:

  1. Create or open a parallel animation so the check runs continuously alongside movement animations.
  2. Select your clothing or armor bone group and add a Scale keyframe at timestamp 0.0.
  3. Enter the corresponding slot query into the X, Y, and Z scale fields.
ysm.has_helmet
ysm.has_chest_plate
ysm.has_leggings
ysm.has_boots
If you want a piece of clothing to disappear when armor is equipped (for example, hiding a casual jacket when putting on a chestplate), invert the value using !ysm.has_chest_plate.

Automatic Blinking

Animating eye blinks manually across dozens of animations is tedious. YSM provides the ysm.is_close_eyes query, which automatically triggers a blink state roughly once every 4 seconds.

By placing this logic in a pre_parallel animation, your character will blink naturally during idle, walking, and other standard animations without extra work. You can scale the open-eye mesh down to zero while simultaneously shifting the eyelid or eyebrow bone slightly downward.

  1. Open your pre_parallel animation.
  2. For the Eyes bone: add a Scale keyframe and set X, Y, and Z to ysm.is_close_eyes ? 0 : 1.
  3. For the Eyebrows (or upper eyelid) bone: add a Position keyframe to lower it by 1 unit during a blink.
// Eye Bone - Scale (X, Y, Z)
ysm.is_close_eyes ? 0 : 1

// Eyebrow Bone - Position (X, Y, Z)
X: 0
Y: ysm.is_close_eyes ? -1 : 0
Z: 0

Eye Tracking (Pupil Follow)

By default, the entire head bone rotates with the player's camera. You can make your model look much more alive by having the pupils subtly shift toward the player's view direction using a parallel animation.

This works by dividing ysm.head_yaw and ysm.head_pitch so the pupils move a fraction of a pixel across the surface of the eye as the head turns.

// Animation: parallel | Bone: Pupils | Keyframe: Position
X: ysm.head_yaw/180
Y: ysm.head_pitch/360
Z: 0
Depending on the size of your model's eyes, you can tweak the divisors (180 and 360) so the pupils do not clip outside the sclera.

Head Rotation Locking

During certain special or cinematic animations (like emotes or sitting poses), automatic camera-based head rotation can ruin the pose and cause severe neck clipping. You can counteract the game's camera rotation and lock the head in place by applying the player's pitch and clamped yaw directly to the head's Rotation keyframe.

Add a Rotation keyframe to the Head bone inside your special animation and use the following values:

// Animation: Special / Emote | Bone: Head | Keyframe: Rotation
X: ysm.head_pitch
Y: math.clamp(ysm.head_yaw,-60,60)
Z: 0

Emissive / Glowing Bone Groups

You do not even need a Molang expression to make parts of your model glow in the dark. Adding the prefix ysmGlow to any bone group name in Blockbench makes all cubes inside that group render at full brightness (emissive).

For example, naming a bone group ysmGlowEyes or ysmGlowHalo will make those elements glow in dark caves or at night.

The ysmGlow prefix is strictly case-sensitive—make sure the capital 'G' matches exactly.

Questions

What is the difference between `pre_parallel` and `parallel` animations for Molang?

pre_parallel runs before standard animations (great for base states like automatic blinking that other animations might want to override), while parallel runs alongside everything to continuously layer effects like armor toggling or pupil tracking.

Why isn't my `ysmGlow` bone glowing in-game?

Check the capitalization of the bone group name in Blockbench. It must start with ysmGlow (lowercase 'ysm', uppercase 'G'). Also ensure the glowing cubes are actually placed inside that bone group.

How do I preview `ysm.has_chest_plate` or `ysm.is_close_eyes` in Blockbench?

Open the Variable Placeholders panel in Blockbench's animation tab and paste ysm.has_chest_plate = toggle('Chestplate'). A checkbox button will appear that lets you toggle the variable between 0 and 1 while previewing your animation.

Next: Custom Molang Functions in YSM →

More in Molang

λ
Custom Molang Functions in YSMIntroduced in version 2.5.0, custom Molang functions allow model creators to write reusable scripts, respond to entity events, synchronize data across multiplayer servers, and directly override animation controllers. Instead of repeating long Molang expressions inside your animation files, you can organize your logic into clean, standalone script files.
λ
Molang Tips, Extra Queries, and Version Features in YSMYes 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.
λ
Molang Variables in YSM: Complete Beginner GuideMolang variables allow your Yes Steve Model (YSM) creations to dynamically react to in-game player actions, such as looking around, walking, or taking damage. By reading and storing data like movement speed or health, you can create natural physics and responsive animations for your custom models.
λ
Molang in YSM: IntroductionMolang is a simple expression language originally created by Mojang for Minecraft Bedrock Edition animations. In Yes Steve Model (YSM), it allows creators to replace static keyframe numbers with dynamic logic that reacts to in-game player actions. This guide covers how Molang works in YSM, practical animation examples, persistent variables, and in-game debugging commands.