YSM available variable
query.actor_count entity quantity
query.anim_time The current animation playback time (second), if the animation is not played, it is 0
query.body_x_rotation Player ⾝ ⾝ ⾝ X rotating and rotating, the default is 0
query.body_y_rotation Player ⾝ ⾝ ⾝ q q ⻆ ⻆ ⻆ ⻆ ⻆ q q q q q 0
query.cardinal_facing_2d Players' direction (ignore the upper and lower direction, north = 2.0, south = 3.0, west = 4.0, east = 5.0)
Query.distance_from_Camera player and lens distance
query.equipment_count, the number of armor (0-4) equipment equipped
query.eye_target_x_rotation Players regard ⻆ ⻆ X rotating ⻆, defaults to 0
Query.eye_target_y_rotation Players Vision ⻆ Y rotating ⻆ ⻆ ⻆ ⻆ q q q q 0
query.ground_speed player speed (⽶/second)
query.has_cape players are true when there is a puppet, otherwise it is false
query.has_rider Players are true when they are riding, otherwise False
query.head_x_rotation Player head X rotating the ⻆ ⻆, defaults to 0
query.head_y_rotation Player head y to rotate the ⻆ ⻆, defaults to 0
query.health player ⾎ ⾎ ⾎ ⾎
query.Hurt_time Player injury time, defaults to 0
query.is_eating Players are true when they are entering, otherwise False
query.is_first_person Player is True when he is in the first name, otherwise it will be false
query.is_in_water Players are true when they are in the middle, otherwise False is
query.is_in_water_or_rain Players are true when they are in the middle or ⾬, otherwise False is
query.is_jumping Player is true when jumping, otherwise it is false
query.is_on_fire players are true when they are, otherwise False
query.is_on_ground players are true when they are on the ground, otherwise False
query.is_playing_Dead player is true when the player is dying, otherwise it is false
query.is_riding Players are true when riding, otherwise Falsequery.is_sleeping players are true when sleeping, otherwise False is false
query.is_sneaking is true when the player is submerged, otherwise it is false
query.is_spectator player is true when the observer mode, otherwise it is false
query.is_sprinting is true when running, otherwise it is false
query.is_swimming Players are true when swimming, otherwise it is false
query.is_using_item Players are trying items, otherwise False
Query.item_in_use_duration continues to count from 0 until the most ⼤ of the item can make ⽤ ⻓ (seconds), the default is 0
query.item_max_use_duration The most ⼤ ⼤ ⼤ ⼤ ⽤ ⽤ ⻓ ⻓ (second), default to 0
query.item_remaining_use_duration The surplus of the items used by the ⽤ q ⽤ ⽤ ⻓ (second), the default is 0
Query.life_time The current animation is broadcast (second), if the animation is not played, it is 0
query.max_health player's most quantity
query.modify_distance_moved Player ⽔ The total number of mobile distance (⽶)
query.moon_Phase Current phase (0-7)
Query.player_Level's experience level, default
query.time_of_day ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ ⼀ (midnight = 0, ⽇ ⽇ q = 0.25, noon = 0.5, ⽇ q = 0.75)
query.time_stamp The current world is in the time stamp
Query.Vertical_Speed Players Move the vertical component speed (⽶/second), and the upper move to the positive query.Walk_distance Player The total number of movement distances (⽶)
query.yaw_speed physical y ⻆ degree rotation speed
ysm.armor_value armor value (0-20)
ysm.has_helmet Players are true when wearing a helmet, otherwise False
ysm.has_chest_plate Players when wearing pectoral armor is true, otherwise False
ysm.has_leggings Players are True when wearing legs, otherwise False
ysm.has_boots Players are True when wearing boots, otherwise False
ysm.has_mainhand Player ⼿ True when holding items, otherwise it is false
ysm.has_offhand Player auxiliary items are true, otherwise it is false
ysm.is_close_eyes defaults to false, when players need to blink back to True
YSM.IS_RIPTIDE players are true when they are in a current, otherwise False
ysm.has_lytra players return true when wearing spleen, otherwise False
ysm.lytra_rot_x player's X -rotating ⻆ ⻆
ysm.lytra_rot_y player's spinning ⻆ ⻆ ⻆
ysm.lytra_rot_z player's sprinkler zirus ⻆ ⻆
ysm.food_Level returns to player hunger
ysm.firson_mod_hide When the player is installed with a more real first -name model module, and you need to hide the player's head, TRUE, or False
ysm.weather Get the current day, 0: sunny, 1: ⾬ or snow, 2: thunder or Blizzard
YSM.IS_OPEN_AIR players are true when they are in the open -air area, otherwise False
YSM.Effect_level (Potion ID) obtains the player or additional medicine effect level on the player or arrow.Potion ID is a string -type medicine ⽔ ID.Returns the effect level of numerical types of medicine.If it does not exist, return 0.
Example (grade of obtaining the effective recovery effect of ⽬ ⽬ 例 例):
ysm.effect_level ('Minecraft: regeneration')
ysm.relative_block_name (x, y, z) Get the ID of a block near a player.X, y, z are the relative position coordinates of the player as the ⼼ ⼼ ⽅ ⽅, and return to the string type type ⽅ ⽅ ID
Example (block at the foot of the player):
ysm.relative_block_name (0, -1, 0)
Return (in this example is sand):
'Minecraft: sand'
ysm.equipped_enchantment_level (Equipment Slot, Enchantment ID) to obtain the designated enchantment level of the player's equipment.Among them, Equipment Slot is a player equipment slot of the string type, refer to the base rock version of the document, pay attention to distinguish the lowercase; the enchantment id is an enchanting ID, refer to the wiki
Example (Get the Masterpiece of the Main Trip Items):
ysm.equipped_enchantment_level ('Mainhand', 'MINECRAFT: Mending')
return:
1
Molang compilation and summary commonly used in YSM
Available parts: Detecting whether the armor bar has armor, and the undressing/armor removal is achieved by wearing and taking off the armor.
Used for: Parallel animation
Site: clothes/armor
Key frame: Scaling
Helmet ysm.has_helmet
Chest armor ysm.has_chest_plate
Leg protection ysm.has_leggings shoes ysm.has_boots
Eye tracking: Let the pupil follow the player's sight to move the effect of the eye tracking.
Used for: Parallel animation
Site: Pupil/Eye
Key frame: location
X = ysm.head_yaw/180
Y = ysm.head_pitch/360
Z = 0
Head locks: Lock the head and let it rotate without following the perspective.
Used for: part of animation
Site: head
Key frame: rotation
X = ysm.head_pitch
Y = math.clamp (ysm.head_yaw, -60,60)
Z = 0
Automatic blinking: automatically close your eyes according to whether you need to close your eyes (usually once every 4 seconds), and you can use this to be used directly.
Used for: pre_parallel animation
Site: Eyes
Key frame: Scaling
All: ysm.is_close_eyes? 0: 1
Site: eyebrow
Key frame: location
X = 0
Y = ysm.is_close_eyes? -1: 0
Z = 0
Following the upper body: Let the player rotate with the perspective of the upper body and simulate the more real bending over. At the same time, the head needs to adjust the rotation angle of the reverse direction to make it fit (not recommended).
Used for Pre_parallel animation
Site: upper body (each paragraph) (it is recommended to set a new group, for example, group elements on the upbody to the new group Mupbody, so that if this molang is not needed, you can be canceled by the key frame through the pre_parallel.
Key frame: rotation
X = -ysm.head_pitch/3
Y = -ysm.head_yaw/3
Z = 0
Note: YSM.Head_PITCH player up and down perspective angle, ysm.head_yaw player left and right perspective angle.
Explanation: When the player moves the perspective, it will rotate the upper body with one-third of the rate of one-third, add+--number and multiplier according to the needs.
Following rotation of the spleen -parying flight _ Old: Detecting the perspective of the player, the character rotation is performed according to the player's perspective during the spleen. The ALLBODY's axis hub should be in the character center.
Used for: Elytra_fly/SWIM animation
Site: whole body
Key frame: rotation
X = -ysm.Head_pitch*Any multiple rate+any value
Y = 0
Z = -ysm.head_yaw*Any multiple rate
Note: YSM.Head_PITCH player up and down perspective angle, ysm.head_yaw player left and right perspective angle.
Explanation: When the player moves the perspective, it will rotate the whole body at a certain rate, add+-number and change the multiplier according to the needs.
Hunger Testing: When the character is full than a certain value, it is rotated or moved to a certain part to make the corresponding effect
ysm.food_level <6? 25: 0
In the same way, there are also experience -based Molalang
query.player_level
Flashing parts: Flashing a certain part when the character residues
Used for: ATTACKED/PARALLEL animation
Site: Halo/Shield/Any
Key frame: Scaling
All/according to needs: (math.random (0, query.max_health*0.5) Note: math.random (minimum value, maximum value), takes the random number between two values for each tick. Explanation: 0 ~ 50%(can be changed) the maximum health value per TICK, if less than the current health value, zoom 1, no Then zoom 0 (The player's location/halo will flicker randomly when the health value is less than 50%. The lower the health, the lower the probability, the less visible until it is not visible.) Site convulsion shake: Used for: ATTACKED/PARALLEL animation Site: Halo/Shield/Any Key frame: location According to demand: (math.random (0, query.max_health*0.5) Explanation: 0 ~ 50%(can be changed) to the maximum health every Tick, if less than the current health, the random number between the -1 ~ 1 (The player's location/halo will be randomly shake when the health is less than 50%. The lower the health, the higher the hiking frequency) Long hair anti -wear mold: By detecting the perspective of the player, let the long hair rotate, realize that you do not grow your hair to wear your chest, and your head will not be backbone long hair. Used for: Parallel animation Site: long hair Key frame: rotation X = (ysm.head_pitch> 0)? (1.2*ysm.head_pitch): (0.35*ysm.head_pitch) y = 0 0 Z = 0 Note: YSM.Head_PITCH player up and down perspective angle, ysm.head_yaw player left and right perspective angle. Explanation: If the player's vertical perspective is greater than 0, the angle angle of 1.2 times is rotated. If it is less than 0, the angle angle of the perspective is 0.35 times.You can also change the rate according to demand or use math.clamp (value, minimum value, maximum value) to limit the rotation angle. Camera distance detection: detect the distance between the player and the camera perspective. If the distance is too close, it will be reduced or moved by expressions such as expressions Used for: Parallel animation Location: Emok/Arimades Key frame: position/scaling query.is_firson? 0: (query.distance_from_camera <1.5? -1: 0) Note: Query.is_first_Person is in the first person, query.distance_from_camera player distance from the camera. Explanation: When the player is in the first person, nothing happens. When the player is not in the first person, the distance between the player (ROOT) and the camera, if it is less than 1.5m, move the expression. War loss explosion: detect the current health of the player. If it is less than a certain blood volume, output 0, otherwise output 1. Used for: Parallel animation Site: armor/clothes Key frame: Scaling (query.health/qury.max_health)< 0.5?0:1 Explanation: If the current percentage of the player is less than 50%(can be changed, it is recommended to use different values in different parts), it will disappear. Running tilt: By detecting the player's perspective, let it tilt the body from the left and right when running (now default comes) Used for: RUN animation Site: root Key frame: rotation X = 0 Y = 0 Z = ysm.head_yaw/3 Note: YSM.Head_PITCH player up and down perspective angle, ysm.head_yaw player left and right perspective angle. Explanation: Detect the player's left and right perspectives, and tilt from the perspective to the left and right. Running hair flutter with speed: By detecting the velocity of the player, let it flutter with the speed of hair when running Used for: RUN animation Site: longhair/arbitrarily The first frame of the key frame: rotation X = math.sin (query.life_time*wavelength)*query.ground_speed*Peak Y = 0 Z = 0 Physical simulation of hair/cloak: It is an upgraded version of the physics before, which can simulate the rotation of the hair rise and horizontal movement speed of the hair. Through a series of functions for smooth simulation, thank Mr. Yu Qian for your math support: Used for: pre_parallel animation Site: hair/cloak/skirt Key frame: rotation X = ((1-math.exp (-0.1*query.ground_speed)*60)-(query.vertical_speed/math.abs (query.vertical_speed)*(1-math.exp (-0.1*math.abs (query.Vertical_speed))))*30) Y = 0 Z = 0 Swimming/Elerted physical simulation Used for: SWIM/ELYTRA_FLY animation Site: Allbody Key frame: rotation X = 0 Y = ysm.head_yaw*1.5 Z = ysm.head_yaw*0.6 Site: The parent group of the whole body (for example, give the Allbody group element to mallbody)) X = -ysm.head_pitch Y = 0 Z = 0 Site: DOWNBODY Key frame: rotation X = math.abs (ysm.head_yaw) Y = 0 Z = 0