<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3AMolang</id>
	<title>Minecraft:Molang - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3AMolang"/>
	<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Molang&amp;action=history"/>
	<updated>2026-04-09T06:02:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.sasgaming.net/index.php?title=Minecraft:Molang&amp;diff=50402&amp;oldid=prev</id>
		<title>imported&gt;Another10101: small tweaks; removed Template:Navbox add-ons</title>
		<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Molang&amp;diff=50402&amp;oldid=prev"/>
		<updated>2026-03-17T07:24:09Z</updated>

		<summary type="html">&lt;p&gt;small tweaks; removed &lt;a href=&quot;/index.php?title=Template:Navbox_add-ons&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Template:Navbox add-ons (page does not exist)&quot;&gt;Template:Navbox add-ons&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{distinguish|Mojang Studios}}&lt;br /&gt;
{{Work in progress}}&lt;br /&gt;
{{exclusive|bedrock}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Molang&amp;#039;&amp;#039;&amp;#039; is an 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. It is used {{in|BE}} in their [[Minecraft:Add-on|Add-on system]] with its purpose being to enable low-level systems like animation to support flexible data-driven behavior for both internal and external creators, while staying highly performant. Molang&amp;#039;s syntax is based off the {{w|C (programming language)|C}} language.&amp;lt;ref&amp;gt;[https://docs.microsoft.com/en-us/minecraft/creator/reference/content/molangreference/examples/molangconcepts/molangintroduction &amp;quot;Molang Documentation - Introduction to Molang&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Minecraft:Mojang Studios]] provides [https://docs.microsoft.com/en-us/minecraft/creator/reference/content/molangreference/ official documentation] which goes into details of how the language works and where it is used. The [https://wiki.bedrock.dev/ Bedrock Wiki] provides more areas of Molang where the official documentation may not cover.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
Molang expressions are used to output values, usually numbers, that can dynamically change. This allows for more complex behavior to be coded for within the restrictions of [[Minecraft:JSON]]. Molang can be used in various places within the JSON files of both [[Minecraft:resource pack]]s (the client) and [[Minecraft:behavior pack]]s (the server):&lt;br /&gt;
*Values in [[Minecraft:Particles (Bedrock Edition)|particle]] components&lt;br /&gt;
*Values in the &amp;lt;code&amp;gt;scripts&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;part_visibility&amp;lt;/code&amp;gt; fields of entity definitions&lt;br /&gt;
*Values in the &amp;lt;code&amp;gt;scripts&amp;lt;/code&amp;gt; field of attachables&lt;br /&gt;
*Values in animations&lt;br /&gt;
*Conditions in the &amp;lt;code&amp;gt;transitions&amp;lt;/code&amp;gt; fields of animation controllers&lt;br /&gt;
*Conditions in the &amp;lt;code&amp;gt;permutations&amp;lt;/code&amp;gt; field of block behaviors&lt;br /&gt;
*Arrays and resource allocations in render controllers&lt;br /&gt;
*Values within certain entity components&lt;br /&gt;
*Data fields in [[Minecraft:recipe]] objects&lt;br /&gt;
&lt;br /&gt;
== Guide ==&lt;br /&gt;
Molang expressions are stored as plain text strings in [[Minecraft:JSON]] files, enclosed with &amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;. As such, &amp;lt;code&amp;gt;&amp;#039;&amp;lt;/code&amp;gt; must be used instead for any string definitions within the expression. Unlike [[Minecraft:commands]], expressions are case-insensitive, meaning capitalization will not affect how they are interpreted. &lt;br /&gt;
&lt;br /&gt;
For expressions with only a single statement, the terminating symbol &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; can be removed. Expressions with multiple statements need &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; in order to separate individual statements.&lt;br /&gt;
&amp;lt;!-- save info for another article: While developing with Molang, it is recommended to enable content logs (in {{UI|Settings|Creator|link=Settings#Creator}}) to show errors and warnings. However, if you enable file content logs, be careful as if there is a Molang error in an expression that is calculated per frame, while the content log GUI only shows the error once, the content log file will include every instance of that error from every frame, meaning you will likely accumulate potentially Gigabytes of error logs within a relatively short period. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Operators ===&lt;br /&gt;
{{Empty section}}&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
Variables, prefixed with &amp;lt;code&amp;gt;variable.&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;v.&amp;lt;/code&amp;gt;, are values that can be stored for later use within an expression. Most variables can be declared and reassigned using the &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; operator, for example in &amp;lt;code&amp;gt;v.&amp;lt;name&amp;gt; = &amp;lt;value&amp;gt;;&amp;lt;/code&amp;gt;. Variables declared this way can be read and written for the lifetime of their entity or particle and are not maintained when a world is saved and reloaded. &lt;br /&gt;
&lt;br /&gt;
Temporary variables, prefixed with either &amp;lt;code&amp;gt;temp.&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;t.&amp;lt;/code&amp;gt;, only exist while the expression they are declared under is executed.&lt;br /&gt;
&lt;br /&gt;
Context variables, prefixed with &amp;lt;code&amp;gt;context.&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;c.&amp;lt;/code&amp;gt;, are read-only variables that are only available under the context of where the expression reading the variable is defined. For example, &amp;lt;code&amp;gt;context.owning_entity&amp;lt;/code&amp;gt; can only be read from molang expressions added to an attachable file, since the variable returns the entity which has the attachable equipped. &lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
&lt;br /&gt;
==== Queries ====&lt;br /&gt;
Queries, prefixed with &amp;lt;code&amp;gt;q.&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;query.&amp;lt;/code&amp;gt;, return information about the world, entity, etc. as either a boolean or numeric value. They are read-only and cannot be modified.&lt;br /&gt;
For example, &amp;lt;code&amp;gt;query.health&amp;lt;/code&amp;gt; returns the current entity&amp;#039;s health, or 0 is not used within an entity.&lt;br /&gt;
&lt;br /&gt;
Certain queries can also take arguments, which are placed within enclosed brackets after the query name and separated by commas if there are multiple inputs. Arguments can be read as numbers or as strings, where they can be further used as identifiers for objects such as [[Minecraft:Tag (Bedrock Edition)|tag]]s, [[Minecraft:slot]]s, and [[Minecraft:entity|entities]].&lt;br /&gt;
For example, &amp;lt;code&amp;gt;q.is_item_name_any(&amp;#039;slot.weapon.mainhand&amp;#039;, 0, &amp;#039;minecraft:iron_ingot&amp;#039;)&amp;lt;/code&amp;gt; evaluates to either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (true) or &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; (false) based off whether or not the item name (or rather type ID) of the current entity&amp;#039;s first slot of their mainhand (the mainhand only has one slot, unlike the inventory or hotbar. Slot indexes start at 0) matches any of the arguments put after the 2nd one.&lt;br /&gt;
&lt;br /&gt;
While some queries are consistent over both behavior and resource packs, some are exclusive to only one or the other, an example being &amp;lt;code&amp;gt;query.remaining_durability&amp;lt;/code&amp;gt;, which can only be used server-side for the [[Minecraft:item components|item component]] &amp;lt;code&amp;gt;minecraft:repairable&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Math functions ====&lt;br /&gt;
Math functions, prefixed with &amp;lt;code&amp;gt;math.&amp;lt;/code&amp;gt; without a single-letter alias, perform specific mathematic operations, taking data in the same way as certain queries.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;code&amp;gt;math.floor(3.8)&amp;lt;/code&amp;gt; evaluates the input value rounded down as &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{{HistoryTable&lt;br /&gt;
|{{HistoryLine|Bedrock}}&lt;br /&gt;
|{{HistoryLine||?|Added Molang, originally capitalized as &amp;quot;MoLang&amp;quot;.}}&lt;br /&gt;
|{{HistoryLine||1.17.20|dev=beta 1.17.20.23|Molang now uses the &amp;lt;code&amp;gt;min_engine_version&amp;lt;/code&amp;gt; of its resource or behavior pack to allow for versioned changes.}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
{{Navbox Bedrock Edition}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Minecraft:es:Molang]]&lt;br /&gt;
[[Minecraft:fr:Molang]]&lt;br /&gt;
[[Minecraft:ja:Molang]]&lt;br /&gt;
[[Minecraft:lzh:魔琅]]&lt;br /&gt;
[[Minecraft:pt:Molang]]&lt;br /&gt;
[[Minecraft:ru:Molang]]&lt;br /&gt;
[[Minecraft:uk:Molang]]&lt;br /&gt;
[[Minecraft:zh:Molang]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Another10101</name></author>
	</entry>
</feed>