<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Why I can&#x27;t use commandManager or moduleManager in my script]]></title><description><![CDATA[<p dir="auto"><img src="https://img.guildedcdn.com/ContentMediaGenericFiles/d99f70e96ae6fb294b41e757be5c8ec5-Full.webp?w=620&amp;h=63" alt="alt text" class=" img-fluid img-markdown" /><img src="https://img.guildedcdn.com/ContentMediaGenericFiles/6bb665e9236b6c3e3ed9c7e4711accff-Full.webp?w=842&amp;h=133" alt="alt text" class=" img-fluid img-markdown" /><img src="https://img.guildedcdn.com/ContentMediaGenericFiles/f9e2217946e697bf6f62811dd1663d75-Full.webp?w=870&amp;h=146" alt="alt text" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.liquidbounce.net/topic/7671/why-i-can-t-use-commandmanager-or-modulemanager-in-my-script</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 23:34:50 GMT</lastBuildDate><atom:link href="https://forum.liquidbounce.net/topic/7671.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Aug 2023 14:33:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Why I can&#x27;t use commandManager or moduleManager in my script on Wed, 16 Aug 2023 05:36:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/isnotpuppy" aria-label="Profile: isnotpuppy">@<bdi>isnotpuppy</bdi></a> Put this tag on the top of your script:</p>
<pre><code>/// api_version=2

...
code
</code></pre>
<p dir="auto">This will fix the issue.<br />
See: <a href="https://liquidbounce.net/docs/ScriptAPI/Getting%20Started" target="_blank" rel="noopener noreferrer nofollow ugc">https://liquidbounce.net/docs/ScriptAPI/Getting Started</a></p>
<p dir="auto">Also fixed in future versions by removing support for ScriptAPI v1:<br />
<a href="https://github.com/CCBlueX/LiquidBounce/commit/3e92903f1372e1c96225bca057f0f136928d3bd5" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/CCBlueX/LiquidBounce/commit/3e92903f1372e1c96225bca057f0f136928d3bd5</a></p>
<div class="row github-embeds-container">

<div class="col-md-6">
<div class="github-embed card">
<div class="card-body">



<div class="meta">
<span class="float-end">0 <i class="fa fa-comment"></i></span>
<img class="author-picture not-responsive" src="https://avatars.githubusercontent.com/u/12410754?v=4" title="1zun4" />
<a href="https://github.com/1zun4"><span class="username">1zun4</span></a> committed <span class="timeago" title="2023-08-16T05:36:28Z"></span> to <a href="//github.com/CCBlueX/LiquidBounce">CCBlueX/LiquidBounce</a>
</div>
<a href="https://github.com/CCBlueX/LiquidBounce/commit/3e92903f1372e1c96225bca057f0f136928d3bd5"><pre>removed support for ScriptAPI v1

Please update your script to ScriptAPI v2 to avoid issues in the future.
See https://liquidbounce.net/docs/ScriptAPI/Getting%20Started for further information.

This change fixes module and command manager not being defined correctly.
See https://forums.ccbluex.net/topic/7671/why-i-can-t-use-commandmanager-or-modulemanager-in-my-script/</pre></a>

</div>
</div>
</div>

</div>]]></description><link>https://forum.liquidbounce.net/post/38131</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/38131</guid><dc:creator><![CDATA[kawaiinekololis]]></dc:creator><pubDate>Wed, 16 Aug 2023 05:36:58 GMT</pubDate></item><item><title><![CDATA[Reply to Why I can&#x27;t use commandManager or moduleManager in my script on Wed, 16 Aug 2023 05:29:27 GMT]]></title><description><![CDATA[<p dir="auto">So I've been looking into this and I noticed following:</p>
<pre><code class="language-js">try {
    Chat.print(typeof(scriptManager)); // object
    Chat.print(JSON.stringify(scriptManager)); // undefined
    scriptManager.unloadScripts();
    Chat.print("done"); // works
}catch (e) {
    Chat.print(e);
}


try {
    Chat.print(typeof(commandManager)); // [object]
    Chat.print(JSON.stringify(commandManager)); // {}
    commandManager.registerCommands(); // not working -&gt; TypeError: commandManager.registerCommands is not a function
    commandManager.executeCommands('killaura range 3.4'); // not working, stopped above
}catch (e) {
    Chat.print(e);
}

try {
    Chat.print(typeof(moduleManager)); // [object]
    Chat.print(JSON.stringify(moduleManager)); // {}
    moduleManager.registerModules(); // not working -&gt; TypeError: moduleManager.registerModules is not a function
    moduleManager.getModule('KillAura').setState(false); // not working, stopped above
}catch (e) {
    Chat.print(e);
}
</code></pre>
<p dir="auto">After changing the variable name of <code>commandManager</code> and <code>moduleManager</code> to <code>pickaxe</code> and <code>stone</code> it suddenly worked!</p>
<pre><code class="language-kotlin">scriptEngine.put("stone", moduleManager)
scriptEngine.put("pickaxe", commandManager)
scriptEngine.put("scriptManager", scriptManager)
</code></pre>
<p dir="auto">So it seems to be conflicting with something else.</p>
<p dir="auto">Oh my god... I realized. It was caused by the ScriptAPI v1 legacy support script. &gt;(</p>
<pre><code class="language-js">    this.moduleManager = Java.type("net.ccbluex.liquidbounce.LiquidBounce").moduleManager;
    this.Module = Java.type("net.ccbluex.liquidbounce.features.module.Module");
    this.ArrayList = Java.type("java.util.ArrayList");
</code></pre>
]]></description><link>https://forum.liquidbounce.net/post/38130</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/38130</guid><dc:creator><![CDATA[kawaiinekololis]]></dc:creator><pubDate>Wed, 16 Aug 2023 05:29:27 GMT</pubDate></item><item><title><![CDATA[Reply to Why I can&#x27;t use commandManager or moduleManager in my script on Fri, 11 Aug 2023 16:15:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/isnotpuppy" aria-label="Profile: isnotpuppy">@<bdi>isnotpuppy</bdi></a></p>
<p dir="auto">since everything is in kotlin now, you most likely have to do moduleManager.INSTANCE.getModule()<br />
commandManager.INSTANCE....</p>
<p dir="auto">however this may be subject to change in the future because the documentation doesn't show this and it's not good</p>
]]></description><link>https://forum.liquidbounce.net/post/38115</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/38115</guid><dc:creator><![CDATA[CzechHek]]></dc:creator><pubDate>Fri, 11 Aug 2023 16:15:18 GMT</pubDate></item><item><title><![CDATA[Reply to Why I can&#x27;t use commandManager or moduleManager in my script on Sun, 06 Aug 2023 10:43:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/czechhek" aria-label="Profile: CzechHek">@<bdi>CzechHek</bdi></a> ty</p>
]]></description><link>https://forum.liquidbounce.net/post/38105</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/38105</guid><dc:creator><![CDATA[isnotpuppy]]></dc:creator><pubDate>Sun, 06 Aug 2023 10:43:25 GMT</pubDate></item><item><title><![CDATA[Reply to Why I can&#x27;t use commandManager or moduleManager in my script on Sat, 05 Aug 2023 08:07:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/isnotpuppy" aria-label="Profile: isnotpuppy">@<bdi>isnotpuppy</bdi></a> Probably because of the kotlin ports, however this wasn't expected since:</p>
<p dir="auto"><a href="https://github.com/CCBlueX/LiquidBounce/blob/legacy/src/main/java/net/ccbluex/liquidbounce/script/Script.kt#L59-L63" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/CCBlueX/LiquidBounce/blob/legacy/src/main/java/net/ccbluex/liquidbounce/script/Script.kt#L59-L63</a></p>
<p dir="auto">I will look into this.</p>
]]></description><link>https://forum.liquidbounce.net/post/38104</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/38104</guid><dc:creator><![CDATA[CzechHek]]></dc:creator><pubDate>Sat, 05 Aug 2023 08:07:06 GMT</pubDate></item></channel></rss>