YSM Molang reference: YSM player & entity
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 |
|---|---|---|
| ysm.dump_equipped_item(slotType) | Outputs equipped item info to the chat. Only works in animation debug mode.slotType options: chest feet head legs mainhand offhand | 1.2.0 |
| ysm.dump_relative_block<br>(xOffset, yOffset, zOffset) | Outputs info of a nearby block to the chat.Only works in animation debug mode.Centered on the player's lower body. Max value for each parameter is 8. | 1.2.0 |
| ysm.dump_mods | Outputs installed mods info to the chat.Only works in animation debug mode. | 1.2.0 |
| ysm.dump_effects | Outputs active status effects info to the chat.Only works in animation debug mode. | 1.2.0 |
| ysm.dump_biome | Outputs current biome ID and tags to the chat.Only works in animation debug mode. | 1.2.0 |
| ysm.mod_version(modid) | Returns the version of a specified mod installed on the client. | 1.2.0 |
| ysm.equipped_enchantment<br>_level(slotType, id) | Returns the level of a specified enchantment on an equipped item. In 2.5.0+, accepts multiple id arguments and returns the sum of their levels.slotType options: chest feet head legs mainhand offhand | 1.2.0 |
| ysm.effect_level(id) | Returns the level of a status effect on the player or arrow.In 2.5.0+, accepts multiple id arguments and returns the sum of their levels. | 1.2.0 |
| ysm.relative_block_name<br>(xOffset, yOffset, zOffset) | Returns the ID of a nearby block.Centered on the player's lower body. Max value for each parameter is 8. | 1.2.0 |
| ysm.head_yaw | Same as query.head_x_rotation. | 1.1.5 |
| ysm.head_pitch | Same as query.head_y_rotation. | 1.1.5 |
| ysm.weather | Returns the current weather.0: Clear, 1: Rain/Snow, 2: Thunder/Blizzard | 1.2.0 |
| ysm.dimension_name | Returns the current dimension ID. | 1.2.0 |
| ysm.fps | Returns the game FPS. | 1.1.5 |
| ysm.input_vertical | Gets the player's forward/backward movement input.>0 when moving forward, <0 when moving backward, 0 when stationary. | 2.3.0 |
| ysm.input_horizontal | Gets the player's left/right movement input.>0 when moving right, <0 when moving left, 0 when stationary. | 2.3.0 |
| ysm.person_view | Returns the current camera perspective.First-person: 0, Third-person back: 1, Third-person front: 2. Should be compatible with Shoulder Surfing? | 2.3.1 |
| ysm.is_passenger | Same as query.is_riding. | 1.1.5 |
| ysm.is_sleep | Same as query.is_sleeping. | 1.1.5 |
| ysm.is_sneak | Same as query.is_sneaking. | 1.1.5 |
| ysm.biome_category | Gets the category of the player's current biome.Only available in 1.16.5 and 1.18.2. | 1.2.0 |
| ysm.is_open_air | Checks if the player is in an open-air area. | 1.2.0 |
| ysm.eye_in_water | Checks if the player's eyes are underwater (used to determine if fully submerged). | 2.2.1 |
| ysm.frozen_ticks | Increases by 1 per tick when in powder snow (max 140). Decreases by 2 per tick when not, down to 0. | 2.2.1 |
| ysm.air_supply | Air supply value, max 300. | 2.2.1 |
| ysm.has_helmet | true if the player is wearing a helmet, otherwise false. | 1.1.5 |
| ysm.has_chest_plate | true if the player is wearing a chestplate, otherwise false. | 1.1.5 |
| ysm.has_leggings | true if the player is wearing leggings, otherwise false | 1.1.5 |
| ysm.has_boots | true if the player is wearing boots, otherwise false | 1.1.5 |
| ysm.has_mainhand | true if the player is holding an item in the main hand, otherwise false | 1.1.5 |
| ysm.has_offhand | true if the player is holding an item in the off-hand, otherwise false | 1.1.5 |
| ysm.has_elytra | Returns true if the player is wearing an elytra, otherwise false | 1.1.5 |
| ysm.is_riptide | true if the player is in the Riptide state, otherwise false | 1.1.5 |
| ysm.armor_value | Returns the player's armor value | 1.1.5 |
| ysm.is_close_eyes | Defaults to false, returns true when the player needs to blinkBlink interval is around 4 seconds. Also returns true when sleeping | 1.1.5 |
| ysm.rendering_in_inventory | Checks if the model is rendering in a GUI (e.g., model selection screen) Returns true when rendered in these places | 2.2.1 |
| ysm.rendering_in_paperdoll | Checks if the model is rendering in the paperdollThe paperdoll refers to the extra player preview in the top-left corner | 2.3.1 |
| ysm.on_ladder | Boolean, checks if the entity is on a ladder | 2.2.1 |
| ysm.ladder_facing | Facing direction of the ladder the entity is climbingOutputs 0-3, corresponding to: South, West, North, East | 2.2.1 |
| ysm.arrow_count | Number of arrows stuck in the player | 2.2.1 |
| ysm.stinger_count | Number of bee stingers stuck in the player | 2.2.1 |
| ysm.texture_name | Returns the name of the texture currently used by the player (including extension) | 1.2.0 |
| ysm.elytra_rot_x | Returns the X rotation angle of the player's elytra | 1.1.5 |
| ysm.elytra_rot_y | Returns the Y rotation angle of the player's elytra | 1.1.5 |
| ysm.elytra_rot_z | Returns the Z rotation angle of the player's elytra | 1.1.5 |
| ysm.food_level | Returns the player's food level | 1.1.5 |
| ysm.first_person_mod_hide | true when the First-person Model mod is installed and the player's head needs to be hidden, otherwise false | 1.1.5 |
| ysm.has_left_shoulder_parrot | Checks if a parrot is perched on the player's left shoulder | 2.2.1 |
| ysm.has_right_shoulder_parrot | Checks if a parrot is perched on the player's right shoulder | 2.2.1 |
| ysm.left_shoulder<br>_parrot_variant | Returns the variant of the parrot on the player's left shoulderVersions 1.19 and earlier do not have string-based parrot color variants, so this variable is only available in 1.20+ | 2.2.1 |
| ysm.right_shoulder<br>_parrot_variant | Returns the variant of the parrot on the player's right shoulderVersions 1.19 and earlier do not have string-based parrot color variants, so this variable is only available in 1.20+ | 2.2.1 |
| ysm.attack_damage | Player's attack damage, inherited from player attributes | 2.2.1 |
| ysm.attack_speed | Player's attack speed, inherited from player attributes | 2.2.1 |
| ysm.attack_knockback | Player's attack knockback, inherited from player attributes | 2.2.1 |
| ysm.movement_speed | Player's base movement acceleration, inherited from player attributes | 2.2.1 |
| ysm.knockback_resistance | Player's knockback resistance, inherited from player attributes | 2.2.1 |
| ysm.luck | Player's luck value, inherited from player attributes | 2.2.1 |
| ysm.block_reach | Player's block reach distance, inherited from player attributes | 2.2.1 |
| ysm.entity_reach | Player's entity reach distance, inherited from player attributes | 2.2.1 |
| ysm.swim_speed | Player's swim speed, inherited from player attributes | 2.2.1 |
| ysm.entity_gravity | Gravity applied to the player (falling acceleration), inherited from player attributes | 2.2.1 |
| ysm.step_height_addition | Additional step height (determines the max height a player can step up without jumping and the min height preventing falling while sneaking), inherited from player attributes | 2.2.1 |
| ysm.nametag_distance | Render distance of the nametag | 2.2.1 |
| ysm.first_order(name, input, response) | First-order system function | 2.3.0 |
| ysm.second_order(name, input, frequency, coefficient, response) | Second-order system function | 2.3.0 |
| ysm.bone_rot(name).x | Gets the X-axis rotation value of the specified bone from the previous frame | 2.2.2 |
| ysm.bone_rot(name).y | Gets the Y-axis rotation value of the specified bone from the previous frame | 2.2.2 |
| ysm.bone_rot(name).z | Get the Z-axis rotation of a specific bone from the previous frame | 2.2.2 |
| ysm.bone_pos(name).x | Get the X-axis position of a specific bone in model-relative space | 2.2.2 |
| ysm.bone_pos(name).y | Get the Y-axis position of a specific bone in model-relative space | 2.2.2 |
| ysm.bone_pos(name).z | Get the Z-axis position of a specific bone in model-relative space | 2.2.2 |
| ysm.bone_scale(name).x | Get the X-axis scale of a specific bone from the previous frame | 2.2.2 |
| ysm.bone_scale(name).y | Get the Y-axis scale of a specific bone from the previous frame | 2.2.2 |
| ysm.bone_scale(name).z | Get the Z-axis scale of a specific bone from the previous frame | 2.2.2 |
| ysm.bone_pivot_abs(name).x | Get the X-axis pivot position of a specific bone in absolute model space | 2.2.2 |
| ysm.bone_pivot_abs(name).y | Get the Y-axis pivot position of a specific bone in absolute model space | 2.2.2 |
| ysm.bone_pivot_abs(name).z | Get the Z-axis pivot position of a specific bone in absolute model space | 2.2.2 |
| ysm.entity_type | Return the type of the currently rendered entity (since rendering is no longer limited to players)Returns player or maid | 2.4.0 |
| ysm.is_player | Whether the currently rendered entity is a player | 2.4.0 |
| ysm.is_maid | Whether the currently rendered entity is a maid | 2.4.0 |
| ysm.particle('id', x, y, z, dx, dy, dz, speed, count, life_time) | Spawn particles. Parameters match the vanilla particle command, with an extra life_time parameterSee official wiki: [Particle Command](https://minecraft.wiki/w/Commands/particle) | 2.4.0 |
| ysm.abs_particle('id', x, y, z, dx, dy, dz, speed, count, life_time) | Spawn particles. Parameters match the vanilla particle command, with an extra life_time parameterParticles spawned by this function do not rotate with the player's facing direction (spawns in absolute coordinates) | 2.4.0 |
| ysm.mainhand_charged_crossbow | Whether the mainhand is holding a charged crossbow | 2.4.0 |
| ysm.offhand_charged_crossbow | Whether the offhand is holding a charged crossbow | 2.4.0 |
| ysm.is_fishing | Whether the player has cast a fishing bobberAlso applies to maids | 2.4.0 |
| ysm.perlin_noise(seed, x, y, z) | Perlin noise function, returns a float between 0 and 1See Khan Academy's tutorial: [Perlin Noise](https://www.khanacademy.org/computing/computer-programming/programming-natural-simulations/programming-noise/a/perlin-noise) | 2.4.0 |
| ysm.relative_block_name_any<br>(xOffset, yOffset, zOffset, 'blockName1', 'blockName2'...) | Similar to ysm.relative_block_name, but accepts multiple block ID stringsReturns true if at least one ID matches | 2.5.0 |
| ysm.in_shield_block_cooldown | Boolean. Whether currently in the cooldown period after a successful shield blockCooldown lasts 5 ticks | 2.5.0 |
| ysm.xxa<br/>ysm.yya<br/>ysm.zza | Directional movement input values (forward, backward, left, right) when riding an entityForward/backward is ysm.zza Left/right is ysm.xxa Usage of ysm.yya is unknown (no value change observed during vertical movement) | 2.5.0 |
| ysm.play_sound('id', 'sound_name', flags?, volume, pitch)[+new_sound] | Play sound. id is the sound identifier, sound_name uses the same format as sound keyframes. flags are special bit flagsWhen set to force play, each execution stops any previously playing sound with the same ID and restarts it from the beginning. | 2.5.0 |
| ysm.stop_sound('id', global?)[+new_sound] | Stop sound. id is the sound identifier | 2.5.0 |
| ysm.stop_all_sounds(global?)[+new_sound] | Stop all sounds played via Molang | 2.5.0 |
| ysm.block_light | Block light level at the entity's feet0-15 | 2.5.0 |
| ysm.sky_light | Sky light level at the entity's feet0-15, 15 when fully exposed to the sky | 2.5.0 |
| ysm.mouse(keycode) [+client] | Detect mouse button stateEnter keycode: [Mouse button numbers](https://www.glfw.org/docs/latest/group__buttons.html) | 2.5.0 |
| ysm.keyboard(keycode1, keycode2, ...) [+client] | Detect keyboard key stateEnter keycode: [Key numbers](https://www.glfw.org/docs/latest/group__keys.html). Supports 1 or more arguments. When multiple arguments are provided, returns true if any of the keys is pressed | 2.5.0 |
| ysm.time_delta | Time interval between two frames | 2.5.0 |
| ysm.sync(int1, int2, ...) | Actively sync data to the server. Refer to the custom functions section for details | 2.5.0 |
| ysm.ground_speed2 | Return player speedBoth this and query.ground_speed represent character speed, but this value syncs between players on the server.Returns a slightly larger value than query.ground_speed | 2.5.1 |
| ysm.hit_target_id | Return the ID of the block or entity the crosshair is pointing atReturns an empty string if pointing at nothing | 2.6.0 |
| ysm.hit_target_type | Return the target type the crosshair is pointing atReturns block for blocks Returns entity for entities Returns an empty string if pointing at nothing | 2.6.0 |
| ysm.swinging | Boolean. Returns true when the player is swinging their arm | 2.6.0 |
| ysm.swing_time | Integer. Returns the swing tick count when the player is swinging, usually under 10 | 2.6.0 |
| ysm.swinging_arm | The swinging arm: 0 for mainhand, 1 for offhandAlways returns 0 when not swinging, so use it together with ysm.swinging | 2.6.0 |
| ysm.attack_time | Float. Attack wind-up counter between 0 and 1. Triggers the attack when it reaches 1Simply understood as a pre-attack wind-up counter | 2.6.0 |