1
0
mirror of https://github.com/Mojang/bedrock-samples.git synced 2024-11-23 11:16:14 +00:00
bedrock-samples/documentation/Molang.html
Mike Ammerlaan 6e0daa70a8 v1.21.40.3
2024-10-22 09:25:09 -07:00

2031 lines
131 KiB
HTML

<h1>MOLANG DOCUMENTATION </br>Version: 1.21.40.3</h1>
<h2><p id="Index">Index</p></h2>
<table border="1">
<tr> <th><a href="#Why Does Molang Exist?">Why Does Molang Exist?</a></th> </tr>
<tr> <th><a href="#Lexical Structure">Lexical Structure</a></th> </tr>
<tr> <td> <a href="#Case Sensitivity"> Case Sensitivity</a> </tr> </td>
<tr> <td> <a href="#Keywords"> Keywords</a> </tr> </td>
<tr> <td> <a href="#Operator Precedence"> Operator Precedence</a> </tr> </td>
<tr> <td> <a href="#Variables"> Variables</a> </tr> </td>
<tr> <td> <a href="#Values"> Values</a> </tr> </td>
<tr> <td> <a href="#Query Functions"> Query Functions</a> </tr> </td>
<tr> <td> <a href="#Aliases"> Aliases</a> </tr> </td>
<tr> <td> <a href="#Structs"> Structs</a> </tr> </td>
<tr> <td> <a href="#Strings"> Strings</a> </tr> </td>
<tr> <td> <a href="#Math Functions"> Math Functions</a> </tr> </td>
<tr> <td> <a href="#-> Arrow Operator"> -> Arrow Operator</a> </tr> </td>
<tr> <td> <a href="#{ } Brace Scope Delimiters"> { } Brace Scope Delimiters</a> </tr> </td>
<tr> <td> <a href="#Conditionals"> Conditionals</a> </tr> </td>
<tr> <td> <a href="#loop"> loop</a> </tr> </td>
<tr> <td> <a href="#for_each"> for_each</a> </tr> </td>
<tr> <td> <a href="#break"> break</a> </tr> </td>
<tr> <td> <a href="#continue"> continue</a> </tr> </td>
<tr> <td> <a href="#?? Null Coalescing Operator"> ?? Null Coalescing Operator</a> </tr> </td>
<tr> <td> <a href="#Simple vs Complex Expressions"> Simple vs Complex Expressions</a> </tr> </td>
<tr> <th><a href="#Domain Examples">Domain Examples</a></th> </tr>
<tr> <td> <a href="#Entity Definition Scripts"> Entity Definition Scripts</a> </tr> </td>
<tr> <td> <a href="#Animation and Animation Controller Files"> Animation and Animation Controller Files</a> </tr> </td>
<tr> <td> <a href="#Render Controllers"> Render Controllers</a> </tr> </td>
<tr> <th><a href="#Query Functions">Query Functions</a></th> </tr>
<tr> <td> <a href="#"> </a> </tr> </td>
<tr> <td> <a href="#List of Entity Queries"> List of Entity Queries</a> </tr> </td>
<tr> <td> <a href="#List of Experimental Entity Queries"> List of Experimental Entity Queries</a> </tr> </td>
<tr> <th><a href="#Experimental Operators">Experimental Operators</a></th> </tr>
<tr> <th><a href="#Versioned Changes">Versioned Changes</a></th> </tr>
<tr> <td> <a href="#Versioned Change Versions"> Versioned Change Versions</a> </tr> </td>
</table>
<a href="#Index">Back to top</a>
<h1><p id="Why Does Molang Exist?">Why Does Molang Exist?</p></h1>
Molang is a simple expression-based language designed for fast, data-driven calculation of values at run-time, and with a direct connection to in-game values and systems. Its focus is to enable low-level systems like animation to support flexible data-driven behavior for both internal and external creators, while staying highly performant.</br><a href="#Index">Back to top</a><br><br>
<h1><p id="Lexical Structure">Lexical Structure</p></h1>
The language structure is largely based on simple 'C' language family style syntax. An expression can be made of either one simple value or math calculation, or can be made of several sub-expressions where more complicated code is required.</br></br> In simple cases, the terminating `;` is omitted and the expression result is returned. </br> In complex cases, multiple sub-expressions are each terminated with a semicolon `;`. Complex expressions evaluate to `0.0` unless there is a `return` statement, in which case the evaluated value of the `return`'s sub-expression will be returned out of the current scope.</br><h1><p id="Case Sensitivity">Case Sensitivity</p></h1>
All things in Molang are case-INsensitive, with the exception of strings, which maintain the case provided.</br><a href="#Index">Back to top</a><br><br>
<h1><p id="Keywords">Keywords</p></h1>
All identifiers not in a scope listed below are reserved for future use</br><h2></h2>
<table border="1" style="width:100%; border-style:solid; border-collapse:collapse; border-width:3;">
<tr> <th style="border-style:solid; border-width:3;">Keyword</th> <th style="border-style:solid; border-width:3;">Description</th> </tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`1.23`</td>
<td style="border-style:solid; border-width:3; padding:7px">Numerical constant value</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`! && || < <= >= > == !=`</td>
<td style="border-style:solid; border-width:3; padding:7px">Logical operators</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`* / + -`</td>
<td style="border-style:solid; border-width:3; padding:7px">Basic math operators</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`(` `)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Parentheses for expression term evaluation control</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`{` `}`</td>
<td style="border-style:solid; border-width:3; padding:7px">Braces for execution scope</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`??`</td>
<td style="border-style:solid; border-width:3; padding:7px">Null coalescing operator, for handling missing variables or stale actor references</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`geometry.texture_name`</td>
<td style="border-style:solid; border-width:3; padding:7px">A reference to a geometry named in the entity definition</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`material.texture_name`</td>
<td style="border-style:solid; border-width:3; padding:7px">A reference to a material named in the entity definition</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`texture.texture_name`</td>
<td style="border-style:solid; border-width:3; padding:7px">A reference to a texture named in the entity definition</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.function_name`</td>
<td style="border-style:solid; border-width:3; padding:7px">Various math functions</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`query.function_name`</td>
<td style="border-style:solid; border-width:3; padding:7px">Access to an entity's properties</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`variable.variable_name`</td>
<td style="border-style:solid; border-width:3; padding:7px">Read/write storage on an actor</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`temp.variable_name`</td>
<td style="border-style:solid; border-width:3; padding:7px">Read/write temporary storage</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`context.variable_name`</td>
<td style="border-style:solid; border-width:3; padding:7px">Read-only storage provided by the game in certain scenarios</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`<test> ? <if true>`</td>
<td style="border-style:solid; border-width:3; padding:7px">Binary conditional operator</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`<test> ? <if true> : <if false>`</td>
<td style="border-style:solid; border-width:3; padding:7px">Ternary conditional operator - NOTE: Nested ternary expressions without parentheses were incorrectly parsed before a Versioned Change was made to fix it (see 'Versioned Changes' below)</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`this`</td>
<td style="border-style:solid; border-width:3; padding:7px">The current value that this expression will ultimately write to (context specific)</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`return`</td>
<td style="border-style:solid; border-width:3; padding:7px">For complex expressions, this evaluates the following statement and stops execution of the expression, returns the value computed</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`->`</td>
<td style="border-style:solid; border-width:3; padding:7px">Arrow operator, for accessing data from a different entity</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`loop`</td>
<td style="border-style:solid; border-width:3; padding:7px">For repeating one or more commands 'n' times</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`for_each`</td>
<td style="border-style:solid; border-width:3; padding:7px">For iterating over an array of entities</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`break`</td>
<td style="border-style:solid; border-width:3; padding:7px">For early exiting a loop/for_each scope</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`continue`</td>
<td style="border-style:solid; border-width:3; padding:7px">For skipping the rest of the set of statements of a loop/for_each iteration and moving to the next iteration</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`[` `]`</td>
<td style="border-style:solid; border-width:3; padding:7px">Brackets for array access</br></td>
</tr>
</table>
<a href="#Index">Back to top</a><br><br>
<h1><p id="Operator Precedence">Operator Precedence</p></h1>
Molang Operators follow this order to determine which thing is evaluated first when no parentheses are used. This should match the behavior of C or C++. Operators that are higher in this table are evaluated first, while operators on the same row are evaluated with the same priority. When operators have the same priority, they are evaluated left-to-right, except for the Ternary conditional operator, which is evaluated right-to-left. Using parentheses will allow direct control of order of evaluation, and is recommended for more complex expressions. </br><h2></h2>
<table border="1" style="width:100%; border-style:solid; border-collapse:collapse; border-width:3;">
<tr> <th style="border-style:solid; border-width:3;">Operator Precedence Groups</th> <th style="border-style:solid; border-width:3;">Description</th> </tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">(Highest Precedence)</td>
<td style="border-style:solid; border-width:3; padding:7px">Higher precedence operators are evaluated first when no parentheses are used to control evaluation order</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">Logical Not</td>
<td style="border-style:solid; border-width:3; padding:7px">The Logical Not '!' operator</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">Multiplication and Division</td>
<td style="border-style:solid; border-width:3; padding:7px">Multiplication '*' and Division '/'</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">Addition and Subtraction</td>
<td style="border-style:solid; border-width:3; padding:7px">Addition '+' and Subtraction '-'</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">Comparisons</td>
<td style="border-style:solid; border-width:3; padding:7px">Comparison operators '<' '<=' '>' '>=' (See 'Versioned Changes' below)</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">Equality checks</td>
<td style="border-style:solid; border-width:3; padding:7px">Equality checking operators '==' '!=' (See 'Versioned Changes' below)</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">Logical AND</td>
<td style="border-style:solid; border-width:3; padding:7px">The Logical AND '&&' operator (See 'Versioned Changes' below)</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">Logical OR</td>
<td style="border-style:solid; border-width:3; padding:7px">The Logical OR '||' operator (See 'Versioned Changes' below)</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">Ternary Conditional</td>
<td style="border-style:solid; border-width:3; padding:7px">Ternary conditional operators using '? :'. Evaluated right-to-left when there are multiple ternary operators. (See 'Versioned Changes' below)</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">Null Coalescing</td>
<td style="border-style:solid; border-width:3; padding:7px">Null coalescing operator '??'</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">(Lowest Precedence)</td>
<td style="border-style:solid; border-width:3; padding:7px">Lower precedence operators are evaluated last when no parentheses are used to control evaluation order</br></td>
</tr>
</table>
<a href="#Index">Back to top</a><br><br>
<h1><p id="Variables">Variables</p></h1>
There are three variable lifetimes a variable may belong to: Temporary, Entity, and Context:</br>- Temporary variables (eg: `temp.moo = 1;`) are read/write and valid for the scope they are defined in, as per C rules. For performance reasons their lifetime is global to the current expression execution and may return a valid value outside of the outermost scope they are defined in for an expression. Be careful in complex expressions. We will be adding content errors for invalid accesses as soon as possible.</br>- Entity variables (eg: `variable.moo = 1;`) are read/write and store their value on the entity for the lifetime of that entity. Note that these are currently not saved, so quitting and reloading the world will re-initialize these. In the same way, if the entity is despawned, any variables on the entity will be lost.</br>- Context variables (eg: `context.moo`) are read-only and specified by the game in certain situations. Details on what variables are specified and when will be available in the documentation of the area where that Molang expression is used (such as behaviors defining what context variables they expose).</br><a href="#Index">Back to top</a><br><br>
<h1><p id="Values">Values</p></h1>
<h2></h2>
</br>- All numerical values are floats.</br>- Boolean values such as actor flags are converted and stored as a float value of either 0.0 or 1.0 for values of false or true respectively.</br>- For boolean tests, a float value equivalent to 0.0 is false, and anything not equal to 0.0 is true.</br>- For array indices, floats are C-style-cast to ints, and clamped at zero for negative values or wrapped by the array size for large values.</br>- Other supported types are:</br><a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="37" rows="8">
Geometry
Texture
Material
Actor Reference
Actor Reference Array
String
Struct (see 'structs' section below)
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
- Errors (such as divide by zero, missing variables, null references, etc) generally return a value of 0.0.</br><a href="#Index">Back to top</a><br><br>
<br><br>
<h1><p id="Query Functions">Query Functions</p></h1>
Query functions (eg: `query.is_baby` or `query.is_item_equipped('main_hand')`) allow expressions to read game data. If a query function takes no arguments, do not use parentheses. Otherwise, use parentheses and separate arguments with commas. For a full list of query functions, see below.</br><a href="#Index">Back to top</a><br><br>
<h1><p id="Aliases">Aliases</p></h1>
To reduce typing burden and increase clarity when reading and writing Molang, the following keyword aliases can make life a bit easier. Note that left and right sides function identically.</br><h2></h2>
<h2><p id="Alias Mapping">Alias Mapping</p></h2>
<h3></h3>
<table border="1" style="width:100%; border-style:solid; border-collapse:collapse; border-width:2;">
<tr> <th style="border-style:solid; border-width:2;">Full Name</th> <th style="border-style:solid; border-width:2;">Aliased Name</th> </tr>
<tr>
<td style="border-style:solid; border-width:2; padding:8px">`context.moo`</td>
<td style="border-style:solid; border-width:2; padding:8px">`c.moo`</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:2; padding:8px">`query.moo`</td>
<td style="border-style:solid; border-width:2; padding:8px">`q.moo`</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:2; padding:8px">`temp.moo`</td>
<td style="border-style:solid; border-width:2; padding:8px">`t.moo`</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:2; padding:8px">`variable.moo`</td>
<td style="border-style:solid; border-width:2; padding:8px">`v.moo`</br></td>
</tr>
</table>
<a href="#Index">Back to top</a><br><br>
As an example...</br><a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="102" rows="2">
math.cos(query.anim_time * 38) * variable.rotation_scale + variable.x * variable.x * query.life_time;
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
...can also be written as:</br><a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="72" rows="2">
math.cos(q.anim_time * 38) * v.rotation_scale + v.x * v.x * q.life_time
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
Either syntax will work, and can be intermixed as desired. eg:</br><a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="90" rows="2">
math.cos(q.anim_time * 38) * variable.rotation_scale + v.x * variable.x * query.life_time
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<br><br>
<h1><p id="Structs">Structs</p></h1>
Structures of data, unlike C, are implicitly defined by usage. Their purpose is to more efficiently pass data around, such as passing `v.location` rather than `v.x`, `v.y`, and `v.z`. eg:</br><h2></h2>
<h3></h3>
<br / ><textarea readonly="true" cols="67" rows="5">
v.location.x = 1;
v.location.y = 2;
v.location.z = 3;
v.another_mobs_location = v.another_mob_set_elsewhere->v.location;
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
For some more usage examples, each of the following expressions return 1.23</br><a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="97" rows="2">
v.cowcow.friend = v.pigpig; v.pigpig->v.test.a.b.c = 1.23; return v.cowcow.friend->v.test.a.b.c;
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="112" rows="2">
v.cowcow.friend = v.pigpig; v.pigpig->v.test.a.b.c = 1.23; v.moo = v.cowcow.friend->v.test; return v.moo.a.b.c;
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="112" rows="2">
v.cowcow.friend = v.pigpig; v.pigpig->v.test.a.b.c = 1.23; v.moo = v.cowcow.friend->v.test.a; return v.moo.b.c;
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="112" rows="2">
v.cowcow.friend = v.pigpig; v.pigpig->v.test.a.b.c = 1.23; v.moo = v.cowcow.friend->v.test.a.b; return v.moo.c;
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="112" rows="2">
v.cowcow.friend = v.pigpig; v.pigpig->v.test.a.b.c = 1.23; v.moo = v.cowcow.friend->v.test.a.b.c; return v.moo;
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
Note that structures can be arbitrarily deep in their nesting/recursiveness. That said, it is recommended that you don't copy full structures inside other structures to avoid exploding memory, and not making structures too deep as there is a slight performance cost for each layer.</br><a href="#Index">Back to top</a><br><br>
<br><br>
<h1><p id="Strings">Strings</p></h1>
Strings in Molang are surrounded by single quotes, eg: `'minecraft:pig'` or `'hello world!'`. An empty string is defined as two consecutive single quotes. String operations only support `==` and `!=` at this time.</br>Note: strings don't support the ' character as there is no support for escape characters at this time.</br><a href="#Index">Back to top</a><br><br>
<h1><p id="Math Functions">Math Functions</p></h1>
<h2></h2>
<table border="1" style="width:100%; border-style:solid; border-collapse:collapse; border-width:3;">
<tr> <th style="border-style:solid; border-width:3;">Function</th> <th style="border-style:solid; border-width:3;">Description</th> </tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.abs(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Absolute value of value</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.acos(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">arccos of value</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.asin(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">arcsin of value</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.atan(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">arctan of value</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.atan2(y, x)`</td>
<td style="border-style:solid; border-width:3; padding:7px">arctan of y/x. NOTE: the order of arguments!</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.ceil(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Round value up to nearest integral number</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.clamp(value, min, max)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Clamp value to between min and max inclusive</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.cos(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Cosine (in degrees) of value</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.die_roll(num, low, high)`</td>
<td style="border-style:solid; border-width:3; padding:7px">returns the sum of 'num' random numbers, each with a value from low to high`. Note: the generated random numbers are not integers like normal dice. For that, use `math.die_roll_integer`.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.die_roll_integer(num, low, high)`</td>
<td style="border-style:solid; border-width:3; padding:7px">returns the sum of 'num' random integer numbers, each with a value from low to high`. Note: the generated random numbers are integers like normal dice.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.exp(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Calculates e to the value'th power</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.floor(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Round value down to nearest integral number</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.hermite_blend(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Useful for simple smooth curve interpolation using one of the Hermite Basis functions: `3t^2 - 2t^3`. Note that while any valid float is a valid input, this function works best in the range [0,1].</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.lerp(start, end, 0_to_1)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Lerp from start to end via 0_to_1</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.lerprotate(start, end, 0_to_1)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Lerp the shortest direction around a circle from start degrees to end degrees via 0_to_1</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.ln(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Natural logarithm of value</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.max(A, B)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Return highest value of A or B</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.min(A, B)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Return lowest value of A or B</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.min_angle(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Minimize angle magnitude (in degrees) into the range [-180, 180)</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.mod(value, denominator)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Return the remainder of value / denominator</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.pi`</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the float representation of the constant pi.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.pow(base, exponent)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Elevates `base` to the `exponent`'th power</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.random(low, high)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Random value between low and high inclusive</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.random_integer(low, high)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Random integer value between low and high inclusive</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.round(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Round value to nearest integral number</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.sin(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Sine (in degrees) of value</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.sqrt(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Square root of value</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">`math.trunc(value)`</td>
<td style="border-style:solid; border-width:3; padding:7px">Round value towards zero</br></td>
</tr>
</table>
<a href="#Index">Back to top</a><br><br>
<h1><p id="-> Arrow Operator">-> Arrow Operator</p></h1>
<h2></h2>
Some return values of query function, or values stored in temp/entity/context variables can be a reference to another entity. The `->` operator allows an expression to access variables or run queries on that entity. For example, the example below will find all pigs within four meters of the current entity (including itself if it's a pig), and increment a variable `v.x` on itself if the block immediately above each pig is flammable (such as an oak button) :</br>Note that in the case where the left-hand side of the `->` operator has an error (value is null, the entity was killed previously, or some other issue), the expression will not evaluate the right-hand side and will return 0. This implementation style was a choice between performance and not requiring content creators to overly worry about checking for potentially bad values everywhere.</br></br><h3></h3>
<br / ><textarea readonly="true" cols="77" rows="7">
"v.x = 0;
for_each(v.pig, query.get_nearby_entities(4, 'minecraft:pig'), {
v.x = v.x + v.pig->query.get_relative_block_state(0, 1, 0, 'flammable');
});"
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h2><p id="Public Variables">Public Variables</p></h2>
<h3></h3>
In general, variables of a mob are considered private to that mob and cannot be accessed by another. To expose read-only access of a variable to other mobs, you need to set the 'public' setting on that variable in the owning entity's resource definition. It is also recommended to default-initialize the variable.</br><h4></h4>
<br / ><textarea readonly="true" cols="36" rows="21">
{
"format_version": "1.10.0",
"minecraft:client_entity": {
"description": {
...
"scripts": {
"variables": {
"variable.oink": "public"
},
"initialize": [
"variable.oink = 0;"
],
...
},
...
}
}
}
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<br><br>
<br><br>
<h1><p id="{ } Brace Scope Delimiters">{ } Brace Scope Delimiters</p></h1>
One can group a series of statements into a single group by wrapping them in `{` and `}` symbols. This is used primarily in loops and conditional statements:</br><h2></h2>
<br / ><textarea readonly="true" cols="40" rows="10">
(v.moo > 0) ? {
v.x = math.sin(q.life_time * 45);
v.x = v.x * v.x + 17.3;
t.sin_x = math.sin(v.x);
v.x = t.sin_x * t.sin_x + v.x * v.x;
v.x = math.sqrt(v.x) * v.x * math.pi;
}
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h1><p id="Conditionals">Conditionals</p></h1>
The conditional '?' operator allows for two convenient ways to implement simple branching logic.</br> The first way is to use '?' by itself to conditionally execute part of an expression, for example `A ? B`. The part after the '?' is only run if the part before it evaluates to a true boolean.</br> The second way is to use '?' with a ':' as a 'conditional ternary', for example `A ? B : C`. If the part before the '?' is evaluated as true, the part before the ':' is returned. Otherwise the part after is returned.</br> NOTE: Nested ternary expressions without parentheses were incorrectly parsed before a Versioned Change was made to fix it (see 'Versioned Changes' below).</br><h2></h2>
Conditional Examples<br / ><textarea readonly="true" cols="42" rows="6">
v.should_reset_a ? { v.a = 0; }
v.larger_value = (v.a > v.b) ? v.a : v.b;
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h1><p id="loop">loop</p></h1>
Sometimes you want to execute an expression multiple times. Rather than copy-pasting it a bunch, you can use `loop(<count>, <expression>);`. We have placed some arbitrary restrictions on these for safety for now. The maximum loop counter is (as of this document being written) 1024. Also, note that while you can nest loops inside loops pretty much as deep as you want, be careful you don't make a loop so long it will hang your game.</br><h2></h2>
A Fibonacci Calculator<br / ><textarea readonly="true" cols="19" rows="10">
v.x = 1;
v.y = 1;
loop(10, {
t.x = v.x + v.y;
v.x = v.y;
v.y = t.x;
});
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h1><p id="for_each">for_each</p></h1>
`query.get_nearby_entities` (see below) returns an array of entities. In order to iterate through them, you can use the following new built-in function `for_each`. It takes three parameters: `for_each(<variable>, <array>, <expression>);` The variable can be any variable, either a `temp.` or `variable.`, although I'd recommend using `temp.` to not pollute the entity's variable space. The expression is any Molang expression you want to execute for each entry in the array)</br><h2></h2>
<br / ><textarea readonly="true" cols="65" rows="7">
"v.x = 0;
for_each(t.pig, query.get_nearby_entities(4, 'minecraft:pig'), {
v.x = v.x + 1;
});"
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h1><p id="break">break</p></h1>
<h2></h2>
This will exit out of a `loop` or `for_each` early. Eg:</br><a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="72" rows="6">
v.x = 1;
v.y = 1;
loop(10, {t.x = v.x + v.y; v.x = v.y; v.y = t.x; (v.y > 20) ? break;});
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
This will immediately exit the inner-most active loop, as per C-style language rules. If you have:</br><a href="#Index">Back to top</a><br><br>
<h3></h3>
<br / ><textarea readonly="true" cols="60" rows="5">
v.x = 0;
loop(10, {loop(10, {v.x = v.x + 1; (v.x > 5) ? break;});});
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
The `break` statement will terminate the inner loop when `v.x > 5`, and continue processing the outer loop's expression. Note that as v.x is not reset between the outer loops, the second time into the inner loop this will add one more to `v.x` and then exit the inner loop again, resulting in a final value of `v.x` of `6 + 1 + 1 + 1 + ... + 1` = `15`.)</br><a href="#Index">Back to top</a><br><br>
<br><br>
<h1><p id="continue">continue</p></h1>
`continue` functions as per C-style language rules. Currently only supported in `loop` and `for_each`, this will skip to the next iteration of the current loop. See `break` above for more details on inner/outer loops. The following example will result in v.x becoming 6.0, as the increment will be skipped once it reaches that value. Note that it is better to break out of the loop in this contrived example, as it would be more performant than continuing to perform all 10 iterations.</br><h2></h2>
<h3></h3>
<br / ><textarea readonly="true" cols="24" rows="8">
v.x = 0;
loop(10, {
(v.x > 5) ? continue;
v.x = v.x + 1;
});
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<br><br>
<h1><p id="?? Null Coalescing Operator">?? Null Coalescing Operator</p></h1>
Similar to how the null-coalescing operator works in C#, one can now reference a variable that may or may not exist without seeing a content error. If it doesn't, you can now provide a default value to use. Previously, if a variable didn't exist you would get a content error. This was to make sure variables were always initialized correctly to avoid uninitialized variable bugs. Unfortunately this then required initialize scripts, or in some cases some complex work-arounds to make sure variables were initialized. Now, if you know a variable won't be initialized in the first run of a script, you can use the following:</br><h2></h2>
<h3></h3>
<br / ><textarea readonly="true" cols="40" rows="2">
variable.x = (variable.x ?? 1.2) + 0.3;
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
</br>This will use the value of `variable.x` if it is valid, or else 1.2 if `variable.x`:</br>- has not yet been initialized</br>- is a reference to a deleted entity</br>- is an invalid reference</br>- holds an error</br></br>Note that the `??` operator will work with `variable.`s, `temp.`s, and `context.`s that hold numbers or entity references, but not resources such as materials, textures, or geometries (as those must exist and be valid else it's a content error). If the first argument would result in something that can't be resolved, it will return the second argument.</br></br>_Reminder: the standing rule of thumb in Molang is that if something would error or be a bad value, it is converted to 0.0 (and generally throw a content error on screen in non-publish builds. Note that content errors may prevent uploading content to the Marketplace, so please ensure expressions aren't going to do bad things such as dividing by zero)._</br><a href="#Index">Back to top</a><br><br>
<br><br>
<h1><p id="Simple vs Complex Expressions">Simple vs Complex Expressions</p></h1>
<h2></h2>
A simple expression is a single statement, the value of which is returned to the system that evaluated the expression. eg:</br><h3></h3>
<br / ><textarea readonly="true" cols="33" rows="2">
math.sin(query.anim_time * 1.23)
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
A complex expression is one with multiple statements, each ending in a ';'. Each statement is evaluated in order. In the current implementation, the last statement requires the use of the return keyword and defines the resulting value of the expression. eg:</br><h3></h3>
<br / ><textarea readonly="true" cols="45" rows="4">
temp.moo = math.sin(query.anim_time * 1.23);
temp.baa = math.cos(query.life_time + 2.0);
return temp.moo * temp.moo + temp.baa;
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
Note that in a simple expression, `;` is not allowed, whereas in a complex expression, each statement requires a `;` including the last. Also, note that if you don't `return` a value from a complex expression, the expression will evaluate to 0.0.</br><a href="#Index">Back to top</a><br><br>
<br><br>
<br><br>
<h1><p id="Domain Examples">Domain Examples</p></h1>
<h1><p id="Entity Definition Scripts">Entity Definition Scripts</p></h1>
In the definition file there is a section for pre-computing values. These are executed immediately before animation and render controllers are processed, and stored in the entity. The purpose is to pre-compute any expensive and complex values you may want to reuse in your scripts, long-living index variable updates, or generally any one-off computation per render tick.</br><h2></h2>
<br / ><textarea readonly="true" cols="110" rows="7">
"scripts": {
"pre_animation": [
"variable.my_constant = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed;",
"variable.my_constant2 = Math.exp(1.5);",
]
},
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h1><p id="Animation and Animation Controller Files">Animation and Animation Controller Files</p></h1>
These are numerical operations to control which animations are playing and how to animate bones. "variable.variable_name" and "query.function_name" refer to the entity currently being rendered. They have access to everything in the language except material, texture, and geometry types.</br><a href="#Index">Back to top</a><br><br>
<h1><p id="Render Controllers">Render Controllers</p></h1>
There are a few different kinds of expressions here, where context implies what is allowed. As with animations, the entity accessors refer to the current entity, however depending on the context one also has access to materials, textures, and geometries. There are two sections in a render controller:</br>-Array definitions (optional)</br>-Resource usage (required)</br>The array definition section allows you to create arrays of resources by resource type if you so desire. These can then be referenced in the resource usage section.</br><h2></h2>
<h2><p id="Array Expressions">Array Expressions</p></h2>
For each of the three resource types (materials, textures, and geometry), you can define an array of resources. The name of the resource is the nice-name from the definition file. Using materials as an example:</br><h3></h3>
<h4></h4>
<br / ><textarea readonly="true" cols="93" rows="12">
"arrays":
{
"materials": {
"array.my_array_1": ["material.a", "material.b", "material.c"],
"array.my_array_2" : ["material.d", "material.e"],
"array.my_array_3" : ["array.my_array_1", "material.my_array_2"],
"array.my_array_4" : ["array.my_array_2", "material.my_array_3"],
"array.my_array_5" : ["array.my_array_1", "material.my_array_1", "material.my_array_4"],
"array.my_array_6" : ["array.my_array_1", "material.f"],
...
},
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
Note that all elements of an array must be of the same type. eg: a texture array must only contain textures.</br></br>An array can reference any combination of zero or more arrays (including duplicates if desired) and/or zero or more materials (again, including duplicates if you like), and you can have as many arrays as you like, each with as many elements as you like. If an array includes arrays in its members, they do not need to be the same length. When indexing into an array in the resource usage section, you use numerical expressions. If the resulting number is negative, it will use zero as the index. Any non - negative index will converted to an integer, and will wrap based on the size of the array:</br><h4></h4>
<br / ><textarea readonly="true" cols="47" rows="2">
index = max(0, expression_result) % array_size
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<br><br>
<h2><p id="Resource Expression">Resource Expression</p></h2>
A resource expression must return a single resource of a specific type depending on the context.</br>For example, in the "geometry" section, you must produce an expression that will result in a single geometry. Some examples:</br><h3></h3>
Cycle through an array of geometries at a rate of one per second<br / ><textarea readonly="true" cols="51" rows="2">
"geometry": "array.my_geometries[query.anim_time]"
</textarea> </br>
Pick a geo based on an entity flag<br / ><textarea readonly="true" cols="68" rows="2">
"geometry": "query.is_sheared ? geometry.sheared : geometry.woolly"
</textarea> </br>
Use a specific geometry<br / ><textarea readonly="true" cols="30" rows="2">
"geometry": "geometry.my_geo"
</textarea> </br>
Use specific geo when sleeping, otherwise flip through an array based on a cosine curve, using index zero for almost half the time while the cosine curve is negative<br / ><textarea readonly="true" cols="127" rows="2">
"geometry": "query.is_sleeping ? geometry.my_sleeping_geo : array.my_geos[math.cos(query.anim_time * 12.3 + 41.9) * 10 + 0.6]"
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h2><p id="Resource Sections">Resource Sections</p></h2>
<h3></h3>
<h3><p id="Geometry">Geometry</p></h3>
The geometry section specifies which geometry to use when rendering. As you can specify as many render controllers as you like in the definition file, a single render controller is only concerned with how to render a single geometry. Note that a geometry can be arbitrarily complex using any number of bones and polygons.</br><a href="#Index">Back to top</a><br><br>
<h3><p id="Materials">Materials</p></h3>
The materials section specifies how to map what material to what bone of the geometry. A single material is mapped to a whole bone. Material expressions are evaluated in the order listed. The first part of each statement is the name of the model part to apply the material to, and the second part is the material to use. The model part name can use * for wild - card matching of characters. For example: </br><h4></h4>
<h6></h6>
<br / ><textarea readonly="true" cols="100" rows="7">
"materials": [
{ "*": "Material.default" },
{ "TailA": "array.hair_colors[variable.hair_color]" },
{ "Mane": "array.hair_colors[variable.hair_color]" },
{ "*Saddle*": "variable.is_leather_saddle ? material.leather_saddle : material.iron_saddle" }
],
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
- This will start by applying Material.default to all model parts.</br>- Next, it will set the material on a model part named "TailA" to the result of the expression "Array.hairColors[variable.hair_color]". This will look up some previously created variable on the entity named hair_color and use that to index into a material array called "array.hair_colors" defined in this render controller. This will overwrite the Material.default material set in the line above.</br>- Third, it will look up the same material as the expression is identical, and apply it to the "Mane" model part.</br>- Lastly, if will find any model part starting with, ending with, or containing "Saddle" (case sensitive) and change its material to either material.leather_saddle or material.iron_saddle depending on the previously set entity variable variable.is_leather_saddle.</br><a href="#Index">Back to top</a><br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<h1><p id="Query Functions">Query Functions</p></h1>
Query Functions are operators that access a wide variety of information. They can return simple true or false values (1.0 or 0.0) or more complex data. See the list of functions below for per-query documentation. Query Functions might not take any parameters. In that case, just `query.function_name` is used. Otherwise parentheses with commas separating arguments should be used, ie `query.function_name(1, 2, 'three')`. For example:</br><h2></h2>
<br / ><textarea readonly="true" cols="79" rows="2">
"position": [ 0.0, "query.is_baby ? -8.0 : 0.0", "query.is_baby ? 4.0 : 0.0" ]
</textarea> </br>
<a href="#Index">Back to top</a><br><br>
<h1><p id="List of Entity Queries">List of Entity Queries</p></h1>
<h2></h2>
<table border="1" style="width:100%; border-style:solid; border-collapse:collapse; border-width:3;">
<tr> <th style="border-style:solid; border-width:3;">Name</th> <th style="border-style:solid; border-width:3;">Description</th> </tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.above_top_solid</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the height of the block immediately above the highest solid block at the input (x,z) position</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.actor_count</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the number of actors rendered in the last frame.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.all</td>
<td style="border-style:solid; border-width:3; padding:7px">Requires at least 3 arguments. Evaluates the first argument, then returns 1.0 if all of the following arguments evaluate to the same value as the first. Otherwise it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.all_animations_finished</td>
<td style="border-style:solid; border-width:3; padding:7px">Only valid in an animation controller. Returns 1.0 if all animations in the current animation controller state have played through at least once, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.all_tags</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns if the item or block has all of the tags specified.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.anger_level</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the anger level of the actor [0,n). On errors or if the actor has no anger level, returns 0. Available on the Server only.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.anim_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the time in seconds since the current animation started, else 0.0 if not called within an animation.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.any</td>
<td style="border-style:solid; border-width:3; padding:7px">Requires at least 3 arguments. Evaluates the first argument, then returns 1.0 if any of the following arguments evaluate to the same value as the first. Otherwise it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.any_animation_finished</td>
<td style="border-style:solid; border-width:3; padding:7px">Only valid in an animation controller. Returns 1.0 if any animation in the current animation controller state has played through at least once, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.any_tag</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns if the item or block has any of the tags specified.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.approx_eq</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if all of the arguments are within 0.000000 of each other, else 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.armor_color_slot</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes the armor slot index as a parameter, and returns the color of the armor in the requested slot. The valid values for the armor slot index are 0 (head), 1 (chest), 2 (legs), 3 (feet) and 4 (body).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.armor_damage_slot</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes the armor slot index as a parameter, and returns the damage value of the requested slot. The valid values for the armor slot index are 0 (head), 1 (chest), 2 (legs), 3 (feet) and 4 (body). Support for entities other than players may be limited, as the damage value is not always available on clients.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.armor_material_slot</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes the armor slot index as a parameter, and returns the armor material type in the requested armor slot. The valid values for the armor slot index are 0 (head), 1 (chest), 2 (legs) and 3 (feet).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.armor_texture_slot</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes the armor slot index as a parameter, and returns the texture type of the requested slot. The valid values for the armor slot index are 0 (head), 1 (chest), 2 (legs), 3 (feet) and 4 (body).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.average_frame_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the time in *seconds* of the average frame time over the last 'n' frames. If an argument is passed, it is assumed to be the number of frames in the past that you wish to query. 'query.average_frame_time' (or the equivalent 'query.average_frame_time(0)') will return the frame time of the frame before the current one. 'query.average_frame_time(1)' will return the average frame time of the previous two frames. Currently we store the history of the last 30 frames, although note that this may change in the future. Asking for more frames will result in only sampling the number of frames stored.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.block_face</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the block face for this (only valid for certain triggers such as placing blocks, or interacting with block) (Down=0.0, Up=1.0, North=2.0, South=3.0, West=4.0, East=5.0, Undefined=6.0).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.block_has_all_tags</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes a world-origin-relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has all of the tags provided.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.block_has_any_tag</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes a world-origin-relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has any of the tags provided.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.block_neighbor_has_all_tags</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes a block-relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has all of the tags provided.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.block_neighbor_has_any_tag</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes a block-relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has any of the tags provided.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.block_property</td>
<td style="border-style:solid; border-width:3; padding:7px">(No longer available in pack min_engine_version 1.20.40.) Returns the value of the associated block's Block State.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.block_state</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the value of the associated block's Block State.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.blocking</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is blocking, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.body_x_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the body pitch rotation if called on an actor, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.body_y_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the body yaw rotation if called on an actor, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.bone_aabb</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the axis aligned bounding box of a bone as a struct with members '.min', '.max', along with '.x', '.y', and '.z' values for each.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.bone_orientation_matrix</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes the name of the bone as an argument. Returns the bone orientation (as a matrix) of the desired bone provided it exists in the queryable geometry of the mob, else this returns the identity matrix and throws a content error.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.bone_orientation_trs</td>
<td style="border-style:solid; border-width:3; padding:7px">TRS stands for Translate/Rotate/Scale. Takes the name of the bone as an argument. Returns the bone orientation matrix decomposed into the component translation/rotation/scale parts of the desired bone provided it exists in the queryable geometry of the mob, else this returns the identity matrix and throws a content error. The returned value is returned as a variable of type 'struct' with members '.t', '.r', and '.s', each with members '.x', '.y', and '.z', and can be accessed as per the following example: v.my_variable = q.bone_orientation_trs('rightarm'); return v.my_variable.r.x;</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.bone_origin</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the initial (from the .geo) pivot of a bone as a struct with members '.x', '.y', and '.z'.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.bone_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the initial (from the .geo) rotation of a bone as a struct with members '.x', '.y', and '.z' in degrees.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.camera_distance_range_lerp</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes two distances (any order) and return a number from 0 to 1 based on the camera distance between the two ranges clamped to that range. For example, 'query.camera_distance_range_lerp(10, 20)' will return 0 for any distance less than or equal to 10, 0.2 for a distance of 12, 0.5 for 15, and 1 for 20 or greater. If you pass in (20, 10), a distance of 20 will return 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.camera_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the rotation of the camera. Requires one argument representing the rotation axis you would like (0 for x, 1 for y).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.can_climb</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity can climb, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.can_damage_nearby_mobs</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity can damage nearby mobs, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.can_dash</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity can dash, else it returns 0.0</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.can_fly</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity can fly, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.can_power_jump</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity can power jump, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.can_swim</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity can swim, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.can_walk</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity can walk, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.cape_flap_amount</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns value between 0.0 and 1.0 with 0.0 meaning cape is fully down and 1.0 is cape is fully up.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.cardinal_block_face_placed_on</td>
<td style="border-style:solid; border-width:3; padding:7px">DEPRECATED (please use query.block_face instead) Returns the block face for this (only valid for on_placed_by_player trigger) (Down=0.0, Up=1.0, North=2.0, South=3.0, West=4.0, East=5.0, Undefined=6.0).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.cardinal_facing</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the current facing of the player (Down=0.0, Up=1.0, North=2.0, South=3.0, West=4.0, East=5.0, Undefined=6.0).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.cardinal_facing_2d</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the current facing of the player ignoring up/down part of the direction (North=2.0, South=3.0, West=4.0, East=5.0, Undefined=6.0).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.cardinal_player_facing</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the current facing of the player (Down=0.0, Up=1.0, North=2.0, South=3.0, West=4.0, East=5.0, Undefined=6.0).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.combine_entities</td>
<td style="border-style:solid; border-width:3; padding:7px">Combines any valid entity references from all arguments into a single array. Note that order is not preserved, and duplicates and invalid values are removed.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.cooldown_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the total cooldown time in seconds for the item held or worn by the specified equipment slot name (and if required second numerical slot id), otherwise returns 0. Uses the same name and id that the replaceitem command takes when querying entities.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.cooldown_time_remaining</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the cooldown time remaining in seconds for specified cooldown type or the item held or worn by the specified equipment slot name (and if required second numerical slot id), otherwise returns 0. Uses the same name and id that the replaceitem command takes when querying entities. Returns highest cooldown if no parameters are supplied.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.count</td>
<td style="border-style:solid; border-width:3; padding:7px">Counts the number of things passed to it (arrays are counted as the number of elements they contain; non-arrays count as 1).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.current_squish_value</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the squish value for the current entity, or 0.0 if this doesn't make sense.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.dash_cooldown_progress</td>
<td style="border-style:solid; border-width:3; padding:7px">(No longer available in pack min_engine_version 1.20.50.) DEPRECATED. DO NOT USE AFTER 1.20.40. Please see camel.entity.json script.pre_animation for example of how to now process dash cooldown. Returns dash cooldown progress if the entity can dash, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.day</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the day of the current level.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.death_ticks</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the elapsed ticks since the mob started dying.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.debug_output</td>
<td style="border-style:solid; border-width:3; padding:7px">debug log a value to the output debug window for builds that have one</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.delta_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the time in seconds since the previous frame.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.distance_from_camera</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the distance of the root of this actor or particle emitter from the camera.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.effect_emitter_count</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the total number of active emitters of the callee's particle effect type.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.effect_particle_count</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the total number of active particles of the callee's particle effect type.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.equipment_count</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the number of equipped armor pieces for an actor from 0 to 5, not counting items held in hands. (To query for hand slots, use query.is_item_equipped or query.is_item_name_any).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.equipped_item_all_tags</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes a slot name followed by any tag you want to check for in the form of 'tag_name' and returns 1 if all of the tags are on that equipped item, 0 otherwise.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.equipped_item_any_tag</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes a slot name followed by any tag you want to check for in the form of 'tag_name' and returns 0 if none of the tags are on that equipped item or 1 if at least 1 tag exists.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.equipped_item_is_attachable</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes the desired hand slot as a parameter (0 or 'main_hand' for main hand, 1 or 'off_hand' for off hand), and returns whether the item is an attachable or not.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.eye_target_x_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the X eye rotation of the entity if it makes sense, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.eye_target_y_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the Y eye rotation of the entity if it makes sense, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.facing_target_to_range_attack</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is attacking from range (i.e. minecraft:behavior.ranged_attack), else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.frame_alpha</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the ratio (from 0 to 1) of how much between AI ticks this frame is being rendered.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.get_actor_info_id</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the integer id of an actor by its string name.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.get_animation_frame</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the current texture of the item</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.get_default_bone_pivot</td>
<td style="border-style:solid; border-width:3; padding:7px">Gets specified axis of the specified bone orientation pivot.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.get_equipped_item_name</td>
<td style="border-style:solid; border-width:3; padding:7px">DEPRECATED (Use query.is_item_name_any instead if possible so names can be changed later without breaking content.) Takes one optional hand slot as a parameter (0 or 'main_hand' for main hand, 1 or 'off_hand' for off hand), and a second parameter (0=default) if you would like the equipped item or any non-zero number for the currently rendered item, and returns the name of the item in the requested slot (defaulting to the main hand if no parameter is supplied) if there is one, otherwise returns ''.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.get_locator_offset</td>
<td style="border-style:solid; border-width:3; padding:7px">Gets specified axis of the specified locator offset.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.get_name</td>
<td style="border-style:solid; border-width:3; padding:7px">DEPRECATED (Use query.is_name_any instead if possible so names can be changed later without breaking content.)Get the name of the mob if there is one, otherwise return ''.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.get_root_locator_offset</td>
<td style="border-style:solid; border-width:3; padding:7px">Gets specified axis of the specified locator offset of the root model.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.ground_speed</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the ground speed of the entity in meters/second.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.had_component_group</td>
<td style="border-style:solid; border-width:3; padding:7px">Usable only in behavior packs when determining the default value for an entity's Property. Requires one string argument. If the entity is being loaded from data that was last saved with a component_group with the specified name, returns 1.0, otherwise returns 0.0. The purpose of this query is to allow entity definitions to change and still be able to load the correct state of entities. </br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_any_family</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1 if the entity has any of the specified families, else 0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_armor_slot</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes the armor slot index as a parameter, and returns 1.0 if the entity has armor in the requested slot, else it returns 0.0. The valid values for the armor slot index are 0 (head), 1 (chest), 2 (legs) and 3 (feet).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_biome_tag</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns whether or not a Block Placement Target has a specific biome tag</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_block_property</td>
<td style="border-style:solid; border-width:3; padding:7px">(No longer available in pack min_engine_version 1.20.40.) Returns 1.0 if the associated block has the given block state or 0.0 if not.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_block_state</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the associated block has the given block state or 0.0 if not.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_cape</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the player has a cape, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_collision</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity has collisions enabled, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_dash_cooldown</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity has cooldown on its dash, else it returns 0.0</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_gravity</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is affected by gravity, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_head_gear</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns boolean whether an Actor has an item in their head armor slot or not, or false if no actor in current context</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_owner</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns true if the entity has an owner ID else it returns false</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_player_rider</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1 if the entity has a player riding it in any seat, else it returns 0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_property</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one argument: the name of the property on the Actor. Returns 1.0 if a property with the given name exists, 0 otherwise.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_rider</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity has a rider, else it returns 0.0</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.has_target</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity has a target, else it returns 0.0</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.head_roll_angle</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the roll angle of the head of the entity if it makes sense, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.head_x_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one argument as a parameter. Returns the nth head x rotation of the entity if it makes sense, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.head_y_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one argument as a parameter. Returns the nth head y rotation of the entity if it makes sense, else it returns 0.0. Horses, zombie horses, skeleton horses, donkeys and mules require a second parameter that clamps rotation in degrees.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.health</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the health of the entity, or 0.0 if it doesn't make sense to call on this entity.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.heartbeat_interval</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the heartbeat interval of the actor in seconds. Returns 0 when the actor has no heartbeat.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.heartbeat_phase</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the heartbeat phase of the actor. 0.0 if at start of current heartbeat, 1.0 if at the end. Returns 0 on errors or when the actor has no heartbeat. Available on the Client (Resource Packs) only.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.heightmap</td>
<td style="border-style:solid; border-width:3; padding:7px">Queries Height Map</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.hurt_direction</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the hurt direction for the actor, otherwise returns 0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.hurt_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the hurt time for the actor, otherwise returns 0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.in_range</td>
<td style="border-style:solid; border-width:3; padding:7px">Requires 3 numerical arguments: some value, a minimum, and a maximum. If the first argument is between the minimum and maximum (inclusive), returns 1.0. Otherwise returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.invulnerable_ticks</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the number of ticks of invulnerability the entity has left if it makes sense, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_admiring</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is admiring, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_alive</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is alive, and 0.0 if it's dead.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_angry</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is angry, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_attached</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is attached to another entity (such as being held or worn), else it will return 0.0. Available only with resource packs.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_attached_to_entity</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the actor is attached to an entity, else it will return 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_avoiding_block</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is fleeing from a block, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_avoiding_mobs</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is fleeing from mobs, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_baby</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is a baby, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_breathing</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is breathing, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_bribed</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity has been bribed, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_carrying_block</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is carrying a block, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_casting</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is casting, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_celebrating</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is celebrating, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_celebrating_special</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is doing a special celebration, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_charged</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is charged, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_charging</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is charging, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_chested</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity has chests attached to it, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_cooldown_type</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the specified held or worn item has the specified cooldown type name, otherwise returns 0.0. First argument is the cooldown name to check for, second argument is the equipment slot name, and if required third argument is the numerical slot id. For second and third arguments, uses the same name and id that the replaceitem command takes when querying entities.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_crawling</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is crawling, else it returns 0.0</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_critical</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is critical, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_croaking</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is croaking, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_dancing</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is dancing, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_delayed_attacking</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is attacking using the delayed attack, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_digging</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is digging, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_eating</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is eating, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_eating_mob</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is eating a mob, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_elder</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is an elder version of it, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_emerging</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is emerging, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_emoting</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is emoting, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_enchanted</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is enchanted, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_feeling_happy</td>
<td style="border-style:solid; border-width:3; padding:7px">(No longer available in pack min_engine_version 1.20.50.) DEPRECATED after 1.20.40. Returns 1.0 if behavior.timer_flag_2 is running, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_fire_immune</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is immune to fire, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_first_person</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is being rendered in first person mode, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_ghost</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if an entity is a ghost, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_gliding</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is gliding, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_grazing</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is grazing, or 0.0 if not.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_idling</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is idling, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_ignited</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is ignited, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_illager_captain</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is an illager captain, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_in_contact_with_water</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is in contact with any water (water, rain, splash water bottle), else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_in_lava</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is in lava, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_in_love</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is in love, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_in_ui</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is rendered as part of the UI, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_in_water</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is in water, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_in_water_or_rain</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is in water or rain, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_interested</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is interested, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_invisible</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is invisible, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_item_equipped</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one optional hand slot as a parameter (0 or 'main_hand' for main hand, 1 or 'off_hand' for off hand), and returns 1.0 if there is an item in the requested slot (defaulting to the main hand if no parameter is supplied), otherwise returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_item_name_any</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes an equipment slot name (see the replaceitem command) and an optional slot index value. (The slot index is required for slot names that have multiple slots, for example 'slot.hotbar'.) After that, takes one or more full name (with 'namespace:') strings to check for. Returns 1.0 if an item in the specified slot has any of the specified names, otherwise returns 0.0. An empty string '' can be specified to check for an empty slot. Note that querying slot.enderchest, slot.saddle, slot.armor, or slot.chest will only work in behavior packs. A preferred query to query.get_equipped_item_name, as it can be adjusted by Mojang to avoid breaking content if names are changed.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_jump_goal_jumping</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is doing a jump goal jump, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_jumping</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is jumping, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_laying_down</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is laying down, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_laying_egg</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is laying an egg, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_leashed</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is leashed to something, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_levitating</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is levitating, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_lingering</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is lingering, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_local_player</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes no arguments. Returns 1.0 if the entity is the local player for the current game window, else it returns 0.0. In splitscreen returns 0.0 for the other local players for other views. Always returns 0.0 if used in a behavior pack.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_moving</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is moving, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_name_any</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one or more arguments. If the entity's name is any of the specified string values, returns 1.0. Otherwise returns 0.0. A preferred query to query.get_name, as it can be adjusted by Mojang to avoid breaking content if names are changed.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_on_fire</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is on fire, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_on_ground</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is on the ground, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_on_screen</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if this is called on an entity at a time when it is known if it is on screen, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_onfire</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is on fire, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_orphaned</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is orphaned, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_owner_identifier_any</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one or more arguments. Returns whether the root actor identifier is any of the specified strings. A preferred query to query.owner_identifier, as it can be adjusted by Mojang to avoid breaking content if names are changed.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_persona_or_premium_skin</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the player has a persona or premium skin, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_playing_dead</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is playing dead, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_powered</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is powered, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_pregnant</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is pregnant, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_ram_attacking</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is using a ram attack, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_resting</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is resting, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_riding</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is riding, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_rising</td>
<td style="border-style:solid; border-width:3; padding:7px">(No longer available in pack min_engine_version 1.20.50.) DEPRECATED after 1.20.40. Returns 1.0 if behavior.timer_flag_2 is running, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_roaring</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is currently roaring, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_rolling</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is rolling, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_saddled</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity has a saddle, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_scared</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is scared, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_scenting</td>
<td style="border-style:solid; border-width:3; padding:7px">(No longer available in pack min_engine_version 1.20.50.) DEPRECATED after 1.20.40. Returns 1.0 if behavior.timer_flag_1 is running, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_searching</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is searching, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_selected_item</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns true if the player has selected an item in the inventory, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_shaking</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is casting, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_shaking_wetness</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is shaking water off, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_sheared</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is able to be sheared and is sheared, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_shield_powered</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0f if the entity has an active powered shield if it makes sense, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_silent</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is silent, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_sitting</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is sitting, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_sleeping</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is sleeping, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_sneaking</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is sneaking, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_sneezing</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is sneezing, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_sniffing</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is sniffing, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_sonic_boom</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is using sonic boom, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_spectator</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is spectator, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_sprinting</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is sprinting, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_stackable</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is stackable, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_stalking</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is stalking, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_standing</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is standing, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_stunned</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is currently stunned, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_swimming</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is swimming, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_tamed</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is tamed, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_transforming</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is transforming, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_using_item</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is using an item, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.is_wall_climbing</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is climbing a wall, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.item_in_use_duration</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the amount of time an item has been in use in seconds up to the maximum duration, else 0.0 if it doesn't make sense.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.item_is_charged</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one optional hand slot as a parameter (0 or 'main_hand' for main hand, 1 or 'off_hand' for off hand), and returns 1.0 if the item is charged in the requested slot (defaulting to the main hand if no parameter is supplied), otherwise returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.item_max_use_duration</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the maximum amount of time the item can be used, else 0.0 if it doesn't make sense.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.item_remaining_use_duration</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the amount of time an item has left to use, else 0.0 if it doesn't make sense.Item queried is specified by the slot name 'main_hand' or 'off_hand'.Time remaining is normalized using the normalization value, only if one is given, else it is returned in seconds.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.item_slot_to_bone_name</td>
<td style="border-style:solid; border-width:3; padding:7px">query.item_slot_to_bone_name requires one parameter: the name of the equipment slot. This function returns the name of the bone this entity has mapped to that slot.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.key_frame_lerp_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the ratio between the previous and next key frames.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.last_frame_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the time in *seconds* of the last frame. If an argument is passed, it is assumed to be the number of frames in the past that you wish to query. 'query.last_frame_time' (or the equivalent 'query.last_frame_time(0)') will return the frame time of the frame before the current one. 'query.last_frame_time(1)' will return the frame time of two frames ago. Currently we store the history of the last 30 frames, although note that this may change in the future. Passing an index more than the available data will return the oldest frame stored.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.last_hit_by_player</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity was last hit by the player, else it returns 0.0. If called by the client always returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.lie_amount</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the lie down amount for the entity.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.life_span</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the limited life span of an entity, or 0.0 if it lives forever</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.life_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the time in seconds since the current animation started, else 0.0 if not called within an animation.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.lod_index</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes an array of distances and returns the zero - based index of which range the actor is in based on distance from the camera. For example, 'query.lod_index(10, 20, 30)' will return 0, 1, or 2 based on whether the mob is less than 10, 20, or 30 units away from the camera, or it will return 3 if it is greater than 30.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.log</td>
<td style="border-style:solid; border-width:3; padding:7px">debug log a value to the content log</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.main_hand_item_max_duration</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the use time maximum duration for the main hand item if it makes sense, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.main_hand_item_use_duration</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the use time for the main hand item.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.mark_variant</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the entity's mark variant</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.max_durability</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the max durability an item can take.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.max_health</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the maximum health of the entity, or 0.0 if it doesn't make sense to call on this entity.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.max_trade_tier</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the maximum trade tier of the entity if it makes sense, else it returns 0.0</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.maximum_frame_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the time in *seconds* of the most expensive frame over the last 'n' frames. If an argument is passed, it is assumed to be the number of frames in the past that you wish to query. 'query.maximum_frame_time' (or the equivalent 'query.maximum_frame_time(0)') will return the frame time of the frame before the current one. 'query.maximum_frame_time(1)' will return the maximum frame time of the previous two frames. Currently we store the history of the last 30 frames, although note that this may change in the future. Asking for more frames will result in only sampling the number of frames stored.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.minimum_frame_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the time in *seconds* of the least expensive frame over the last 'n' frames. If an argument is passed, it is assumed to be the number of frames in the past that you wish to query. 'query.minimum_frame_time' (or the equivalent 'query.minimum_frame_time(0)') will return the frame time of the frame before the current one. 'query.minimum_frame_time(1)' will return the minimum frame time of the previous two frames. Currently we store the history of the last 30 frames, although note that this may change in the future. Asking for more frames will result in only sampling the number of frames stored.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.model_scale</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the scale of the current entity.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.modified_distance_moved</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the total distance the entity has moved horizontally in meters (since the entity was last loaded, not necessarily since it was originally created) modified along the way by status flags such as is_baby or on_fire.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.modified_move_speed</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the current walk speed of the entity modified by status flags such as is_baby or on_fire.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.moon_brightness</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the brightness of the moon (FULL_MOON=1.0, WANING_GIBBOUS=0.75, FIRST_QUARTER=0.5, WANING_CRESCENT=0.25, NEW_MOON=0.0, WAXING_CRESCENT=0.25, LAST_QUARTER=0.5, WAXING_GIBBOUS=0.75).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.moon_phase</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the phase of the moon (FULL_MOON=0, WANING_GIBBOUS=1, FIRST_QUARTER=2, WANING_CRESCENT=3, NEW_MOON=4, WAXING_CRESCENT=5, LAST_QUARTER=6, WAXING_GIBBOUS=7).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.movement_direction</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the specified axis of the normalized position delta of the entity.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.noise</td>
<td style="border-style:solid; border-width:3; padding:7px">Queries Perlin Noise Map</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.on_fire_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the time that the entity is on fire, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.out_of_control</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if the entity is out of control, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.overlay_alpha</td>
<td style="border-style:solid; border-width:3; padding:7px">DEPRECATED (Do not use - this function is deprecated and will be removed).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.owner_identifier</td>
<td style="border-style:solid; border-width:3; padding:7px">DEPRECATED (Use query.is_owner_identifier_any instead if possible so names can be changed later without breaking content.) Returns the root actor identifier.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.player_level</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the players level if the actor is a player, otherwise returns 0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.position</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the absolute position of an actor. Takes one argument that represents the desired axis (0 == x-axis, 1 == y-axis, 2 == z-axis).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.position_delta</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the position delta for an actor. Takes one argument that represents the desired axis (0 == x-axis, 1 == y-axis, 2 == z-axis).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.previous_squish_value</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the previous squish value for the current entity, or 0.0 if this doesn't make sense.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.property</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one argument: the name of the property on the entity. Returns the value of that property if it exists, else 0.0 if not.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.relative_block_has_all_tags</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes an entity-relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has all of the tags provided.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.relative_block_has_any_tag</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes an entity-relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has any of the tags provided.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.remaining_durability</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns how much durability an item has remaining.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.ride_body_x_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the body pitch world-rotation of the ride an entity, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.ride_body_y_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the body yaw world-rotation of the ride of on an entity, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.ride_head_x_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the head x world-rotation of the ride of an entity, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.ride_head_y_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one optional argument as a parameter. Returns the head y world-rotation of the ride of an entity, else it returns 0.0. First parameter only for horses, zombie horses, skeleton horses, donkeys and mules that clamps rotation in degrees.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.rider_body_x_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the body pitch world-rotation of a valid rider at the provided index if called on an entity, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.rider_body_y_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the body yaw world-rotation of a valid rider at the provided index if called on an entity, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.rider_head_x_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one argument as a parameter. Returns the head x world-rotation of the rider entity at the provided index, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.rider_head_y_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one or two arguments as parameters. Returns the head y world-rotation of the rider entity at the provided index, else it returns 0.0. Horses, zombie horses, skeleton horses, donkeys and mules require a second parameter that clamps rotation in degrees.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.roll_counter</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the roll counter of the entity.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.rotation_to_camera</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the rotation required to aim at the camera. Requires one argument representing the rotation axis you would like (0 for x, 1 for y).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.scoreboard</td>
<td style="border-style:solid; border-width:3; padding:7px">Takes one argument - the name of the scoreboard entry for this entity. Returns the specified scoreboard value for this entity. Available only with behavior packs.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.shake_angle</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the shaking angle of the entity if it makes sense, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.shake_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the shake time of the entity.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.shield_blocking_bob</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the how much the offhand shield should translate down when blocking and being hit.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.show_bottom</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if we render the entity's bottom, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.sit_amount</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the current sit amount of the entity.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.skin_id</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the entity's skin ID</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.sleep_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the rotation of the bed the player is sleeping on.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.sneeze_counter</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the sneeze counter of the entity.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.spellcolor</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns a struct representing the entity spell color for the specified entity. The struct contains '.r' '.g' '.b' and '.a' members, each 0.0 to 1.0. If no actor is specified, each member value will be 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.standing_scale</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the scale of how standing up the entity is.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.state_time</td>
<td style="border-style:solid; border-width:3; padding:7px">Only valid in an animation controller. Returns the time in seconds in the current animation controller state.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.structural_integrity</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the structural integrity for the actor, otherwise returns 0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.surface_particle_color</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the particle color for the block located in the surface below the actor (scanned up to 10 blocks down). The struct contains '.r' '.g' '.b' and '.a' members, each 0.0 to 1.0. If no actor is specified or if no surface is found, each member value is set to 0.0. Available on the Client (Resource Packs) only.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.surface_particle_texture_coordinate</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the texture coordinate for generating particles for the block located in the surface below the actor (scanned up to 10 blocks down) in a struct with 'u' and 'v' keys. If no actor is specified or if no surface is found, u and v will be 0.0. Available on the Client (Resource Packs) only.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.surface_particle_texture_size</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the texture size for generating particles for the block located in the surface below the actor (scanned up to 10 blocks down). If no actor is specified or if no surface is found, each member value will be 0.0. Available on the Client (Resource Packs) only.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.swell_amount</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns how swollen the entity is.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.swelling_dir</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the swelling direction of the entity if it makes sense, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.swim_amount</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the amount the current entity is swimming.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.tail_angle</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the angle of the tail of the entity if it makes sense, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.target_x_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the x rotation required to aim at the entity's current target if it has one, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.target_y_rotation</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the y rotation required to aim at the entity's current target if it has one, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.texture_frame_index</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the icon index of the experience orb.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.time_of_day</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the time of day (midnight=0.0, sunrise=0.25, noon=0.5, sunset=0.75) of the dimension the entity is in.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.time_since_last_vibration_detection</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the time in seconds since the last vibration detected by the actor. On errors or if no vibration has been detected yet, returns -1. Available on the Client (Resource Packs) only.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.time_stamp</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the current time stamp of the level</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.timer_flag_1</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if behavior.timer_flag_1 is running, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.timer_flag_2</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if behavior.timer_flag_2 is running, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.timer_flag_3</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns 1.0 if behavior.timer_flag_3 is running, else it returns 0.0.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.total_emitter_count</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the total number of active emitters in the world.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.total_particle_count</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the total number of active particles in the world.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.trade_tier</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the trade tier of the entity if it makes sense, else it returns 0.0</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.unhappy_counter</td>
<td style="border-style:solid; border-width:3; padding:7px">Always returns zero. (Was originally meant to indicate Panda unhappiness but due to an early code change it has always only returned zero)</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.variant</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the entity's variant index</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.vertical_speed</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the speed of the entity up or down in meters/second, where positive is up.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.walk_distance</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the total distance traveled by an entity while on the ground and not sneaking.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.wing_flap_position</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the wing flap position of the entity, or 0.0 if this doesn't make sense.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.wing_flap_speed</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the wing flap speed of the entity, or 0.0 if this doesn't make sense.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.yaw_speed</td>
<td style="border-style:solid; border-width:3; padding:7px">Returns the entity's yaw speed</br></td>
</tr>
</table>
<a href="#Index">Back to top</a><br><br>
<h1><p id="List of Experimental Entity Queries">List of Experimental Entity Queries</p></h1>
<h2></h2>
<table border="1" style="width:100%; border-style:solid; border-collapse:collapse; border-width:3;">
<tr> <th style="border-style:solid; border-width:3;">Name</th> <th style="border-style:solid; border-width:3;">Description</th> </tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.client_max_render_distance</td>
<td style="border-style:solid; border-width:3; padding:7px">(EXPERIMENTAL. Enable 'Upcoming Creator Features' to use.) Returns the max render distance in chunks of the current client. Available on the Client (Resource Packs) only.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.client_memory_tier</td>
<td style="border-style:solid; border-width:3; padding:7px">(EXPERIMENTAL. Enable 'Upcoming Creator Features' to use.) Returns a number representing the client RAM memory tier, 0 = 'Undetermined', 1 = 'SuperLow', 2 = 'Low', 3 = 'Mid', 4 = 'High', or 5 = 'SuperHigh'. Available on the Client (Resource Packs) only.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">query.server_memory_tier</td>
<td style="border-style:solid; border-width:3; padding:7px">(EXPERIMENTAL. Enable 'Upcoming Creator Features' to use.) Returns a number representing the server RAM memory tier, 0 = 'Undetermined', 1 = 'SuperLow', 2 = 'Low', 3 = 'Mid', 4 = 'High', or 5 = 'SuperHigh'. Available on the server side (Behavior Packs) only.</br></td>
</tr>
</table>
<a href="#Index">Back to top</a><br><br>
<br><br>
<h1><p id="Experimental Operators">Experimental Operators</p></h1>
Some operators may be behind experimental gameplay toggles (see list below). After getting feedback, we can adjust them further or move them into general availability.</br></br>- (There are currently no Experimental Operators)</br><a href="#Index">Back to top</a><br><br>
<h1><p id="Versioned Changes">Versioned Changes</p></h1>
Molang uses the `"min_engine_version"` from the `manifest.json` of the resource or behavior pack that contains each Molang expression to determine which version of the rules to apply. This allows for changes to how Molang works without breaking existing content. </br></br>Molang Versioned Change versions apply to each expression separately, so it's possible to have different versions active if multiple packs are loaded. </br></br>This is a list of the Versioned Changes that have been added, along with the corresponding game version. </br></br>To know which Versioned Changes are in effect, look at the `"min_engine_version"` of the `manifest.json` of the resource or behavior pack that contains your Molang expression. Any Versioned Change with a version less than or equal to that version number will be in effect. </br><h1><p id="Versioned Change Versions">Versioned Change Versions</p></h1>
<h2></h2>
<table border="1" style="width:100%; border-style:solid; border-collapse:collapse; border-width:3;">
<tr> <th style="border-style:solid; border-width:3;">Pack min_engine_version</th> <th style="border-style:solid; border-width:3;">Description</th> </tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.17.0</td>
<td style="border-style:solid; border-width:3; padding:7px">Initial support for Versioned Changes added. (Not actually a Versioned Change)</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.17.30</td>
<td style="border-style:solid; border-width:3; padding:7px">Fixed query.item_remaining_use_duration conversion from ticks to seconds (multiplied by 20 instead of dividing). Also fixed normalization logic in that query to go from 1 down to 0 instead of 0 up to 1.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.17.40</td>
<td style="border-style:solid; border-width:3; padding:7px">Added some new error messages for invalid expressions which previously ran with probably unexpected results. For example "'text' + 1" will now cause a content error.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.17.40</td>
<td style="border-style:solid; border-width:3; padding:7px">Added error detection for too many operators in parentheses or brackets, for example: `1+(2 3)`. Also added more explicit error detection for when an unknown token is encountered.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.18.10</td>
<td style="border-style:solid; border-width:3; padding:7px">Fixed conditional (ternary) operator associativity. Previously nested conditional expressions like `A ? B : C ? D : E` would evaluate as `(A ? B : C) ? D : E`. Now they evaluate as `A ? B : (C ? D : E)`.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.18.20</td>
<td style="border-style:solid; border-width:3; padding:7px">Fixed Logical AND to evaluate before Logical OR, and for comparison operators to evaluate before equality operators. For example `A && B || C` now evaluates as `(A && B) || C` instead of `A && (B || C)`. And `A < B == C > D` now evalutes as `(A < B) == (C > D)` instead of `((A < B) == C) > D`.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.19.60</td>
<td style="border-style:solid; border-width:3; padding:7px">Fixed error where dividing by a dynamically determined negative variable resulted in a division by the absolute (positive) value of the number instead.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.20.0</td>
<td style="border-style:solid; border-width:3; padding:7px">Fixed query.cape_flap_amount using the wrong player rotation (head rotation instead of body rotation).</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.20.10</td>
<td style="border-style:solid; border-width:3; padding:7px">Renamed block_property and has_block_property to block_state and has_block_state post this version.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.20.40</td>
<td style="border-style:solid; border-width:3; padding:7px">Deprecated block_property and has_block_property.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.20.50</td>
<td style="border-style:solid; border-width:3; padding:7px">dash_cooldown_progress is no longer supported, as that logic is done in the animation. Additionally is_scenting, is_rising, and is_feelingHappy queries are no longer available, and timer_flag_1, timer_flag_2, and timer_flag_3 can be used instead.</br></td>
</tr>
<tr>
<td style="border-style:solid; border-width:3; padding:7px">1.20.70</td>
<td style="border-style:solid; border-width:3; padding:7px">Queries surface_particle_texture_size, surface_particle_texture_coordinate, and surface_particle_texture_size now register leaf blocks as supporting for step particles</br></td>
</tr>
</table>
<a href="#Index">Back to top</a><br><br>
<br><br>