<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.cobblemon.com/index.php?action=history&amp;feed=atom&amp;title=Molang_General_Functions</id>
	<title>Molang General Functions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cobblemon.com/index.php?action=history&amp;feed=atom&amp;title=Molang_General_Functions"/>
	<link rel="alternate" type="text/html" href="https://wiki.cobblemon.com/index.php?title=Molang_General_Functions&amp;action=history"/>
	<updated>2026-05-09T16:32:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.cobblemon.com/index.php?title=Molang_General_Functions&amp;diff=7646&amp;oldid=prev</id>
		<title>UnexpectedlySpicy at 00:51, 8 December 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.cobblemon.com/index.php?title=Molang_General_Functions&amp;diff=7646&amp;oldid=prev"/>
		<updated>2025-12-08T00:51:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:51, 8 December 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;run_command(command: String): Double?&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;run_command(command: String): Double?&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|Runs a command, only works as a server. Returns &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; if run as a client.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|Runs a command, only works as a server. Returns &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; if run as a client&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Will return &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; if successful&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.run_command(&amp;#039;say Hello World&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.run_command(&amp;#039;say Hello World&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>UnexpectedlySpicy</name></author>
	</entry>
	<entry>
		<id>https://wiki.cobblemon.com/index.php?title=Molang_General_Functions&amp;diff=5759&amp;oldid=prev</id>
		<title>JPAKx4: Added MoLang General Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.cobblemon.com/index.php?title=Molang_General_Functions&amp;diff=5759&amp;oldid=prev"/>
		<updated>2025-04-19T21:55:15Z</updated>

		<summary type="html">&lt;p&gt;Added MoLang General Functions&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;These are the &amp;quot;Standard Functions.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable fixed-header sortable fixed-header&amp;quot;&lt;br /&gt;
!Name!!Description!!Usage&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;print(message: String)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Logs a message into the Minecraft console.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.print(&amp;#039;Hello World!&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|set_query&lt;br /&gt;
|IDK&lt;br /&gt;
|IDK&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;replace(text: String, search: String, replace: String): String&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Replaces all occurrences of substring &amp;lt;code&amp;gt;search&amp;lt;/code&amp;gt; inside of &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; with the value of &amp;lt;code&amp;gt;replace&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.replace(&amp;#039;Hexxo Worxd!&amp;#039;, &amp;#039;x&amp;#039;, &amp;#039;l&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;is_blank(value: MoValue): Double&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Checks if the passed value is either a blank string (empty or only whitespace) or a double equal to only &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.isBlank(&amp;#039; &amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;run_command(command: String): Double?&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Runs a command, only works as a server. Returns &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; if run as a client.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.run_command(&amp;#039;say Hello World&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;is_int(val: MoValue): Double&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Returns &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; if a value is an integer, otherwise returns &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.is_int(1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;is_number(val: MoValue): Double&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Returns &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; a value is a double, otherwise returns &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.is_number(3.14)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;to_number(value: MoValue): Double&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Tries to cast to a double, returns &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; if the cast fails.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.to_number(&amp;#039;3.14&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;to_int(val: MoValue): Double&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Tries to cast to an integer, return &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; if it fails.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.to_int(&amp;#039;3&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;to_string(val: MoValue): String&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Casts value to a string.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.to_string(123)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;do_effect_walks(): Double&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Returns &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; if the config has &amp;lt;code&amp;gt;walkingInBattleAnimations&amp;lt;/code&amp;gt; set to true, otherwise returns &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.do_effect_walks(): Double&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;random(options: MoValue...)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Takes a list of values and chooses one by random.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.random(1, 2, 3, 4, 5)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;curve(curveName: String): ObjectValue&amp;lt;(Float) -&amp;gt; Float&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Returns a WaveFunction by the &amp;lt;code&amp;gt;curveName&amp;lt;/code&amp;gt;. ([https://gitlab.com/cable-mc/cobblemon/-/blob/main/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/wavefunction/WaveFunction.kt?ref_type=heads#L102 Options found here])&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.curve(&amp;#039;symmetrical&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;array(values: MoValue...): ArrayStruct&amp;lt;MoValue&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Returns an array from the parameters.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.array(1, 2, 3, 4, 5)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;run_script(identifier: String): MoValue&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Runs a script from an &amp;lt;code&amp;gt;identifier&amp;lt;/code&amp;gt;. Returns the result of the script or &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; if it fails.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.run_script(&amp;#039;cobblemon:npc_battle_cooling_down&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;run_molang(expression: String): MoValue&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Parses a MoLang expression and resolves it using the same context as the MoLang that called it.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.run_molang(&amp;#039;q.print(\&amp;#039;Hello World!\&amp;#039;)&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;system_time_millis(): Double&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Returns the value of the system’s time in milliseconds.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.system_time_millis()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;date_local_time(): String&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Returns the current date in &amp;quot;DD/MM/YYYY&amp;quot; format.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.date_local_time()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;date_of(millis: Double): String&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Takes epoch milliseconds and formats it in &amp;quot;DD/MM/YYYY&amp;quot; format.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.date_of(1000000)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;date_is_after(dateA: String, dateB: String): Double&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Takes two dates in format &amp;quot;DD/MM/YYYY&amp;quot; and returns &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; if the first date is after the second date.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot;&amp;gt;q.date_is_after(&amp;#039;01/01/2024&amp;#039;, &amp;#039;02/01/2024&amp;#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>JPAKx4</name></author>
	</entry>
</feed>