<?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[How to switch hotbar slots via script?]]></title><description><![CDATA[<p dir="auto">Is there a list of things like mc.gameSettings.keyBindUseItem.pressed where i can<br />
look up some things because i cant find anything on google and i dont always want to ask in the Forum.</p>
<p dir="auto">And i really want to become better at scripting but as already  mentioned i cant find<br />
these things i want to look up . Any tips ?</p>
]]></description><link>https://forum.liquidbounce.net/topic/3887/how-to-switch-hotbar-slots-via-script</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 01:55:10 GMT</lastBuildDate><atom:link href="https://forum.liquidbounce.net/topic/3887.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 17 Apr 2022 07:35:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to switch hotbar slots via script? on Sun, 17 Apr 2022 12:13:20 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> said in <a href="/post/29958">How to switch hotbar slots via script?</a>:</p>
<blockquote>
<p dir="auto">mc.playerController.updateController();</p>
</blockquote>
<p dir="auto">Thank u guys so much</p>
]]></description><link>https://forum.liquidbounce.net/post/29960</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/29960</guid><dc:creator><![CDATA[ByGraf]]></dc:creator><pubDate>Sun, 17 Apr 2022 12:13:20 GMT</pubDate></item><item><title><![CDATA[Reply to How to switch hotbar slots via script? on Sun, 17 Apr 2022 11:25:43 GMT]]></title><description><![CDATA[<p dir="auto">Yeah, it has to be updated server-side too, because this: <code>mc.thePlayer.inventory.currentItem</code> only does it client-side.</p>
]]></description><link>https://forum.liquidbounce.net/post/29959</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/29959</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Sun, 17 Apr 2022 11:25:43 GMT</pubDate></item><item><title><![CDATA[Reply to How to switch hotbar slots via script? on Sun, 17 Apr 2022 11:34:38 GMT]]></title><description><![CDATA[<p dir="auto">And this is how you should actually switch the slots on both sides.</p>
<pre><code>mc.thePlayer.inventory.currentItem  = x;
mc.playerController.updateController();
</code></pre>
<p dir="auto">because updateController does this:</p>
<pre><code>    public void updateController()
    {
        this.syncCurrentPlayItem();

        if (this.netClientHandler.getNetworkManager().isChannelOpen())
        {
            this.netClientHandler.getNetworkManager().processReceivedPackets();
        }
        else
        {
            this.netClientHandler.getNetworkManager().checkDisconnected();
        }
    }

    private void syncCurrentPlayItem()
    {
        int i = this.mc.thePlayer.inventory.currentItem;

        if (i != this.currentPlayerItem)
        {
            this.currentPlayerItem = i;
            this.netClientHandler.addToSendQueue(new C09PacketHeldItemChange(this.currentPlayerItem));
        }
    }
</code></pre>
]]></description><link>https://forum.liquidbounce.net/post/29958</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/29958</guid><dc:creator><![CDATA[CzechHek]]></dc:creator><pubDate>Sun, 17 Apr 2022 11:34:38 GMT</pubDate></item><item><title><![CDATA[Reply to How to switch hotbar slots via script? on Sun, 17 Apr 2022 10:54:05 GMT]]></title><description><![CDATA[<p dir="auto">@mems Thanks, I didn't know that</p>
]]></description><link>https://forum.liquidbounce.net/post/29957</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/29957</guid><dc:creator><![CDATA[Ali00035]]></dc:creator><pubDate>Sun, 17 Apr 2022 10:54:05 GMT</pubDate></item><item><title><![CDATA[Reply to How to switch hotbar slots via script? on Sun, 17 Apr 2022 10:38:30 GMT]]></title><description><![CDATA[<p dir="auto">@mems ty so much ur really helping me</p>
]]></description><link>https://forum.liquidbounce.net/post/29956</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/29956</guid><dc:creator><![CDATA[ByGraf]]></dc:creator><pubDate>Sun, 17 Apr 2022 10:38:30 GMT</pubDate></item><item><title><![CDATA[Reply to How to switch hotbar slots via script? on Sun, 17 Apr 2022 10:32:22 GMT]]></title><description><![CDATA[<p dir="auto">This:</p>
<pre><code class="language-t">mc.thePlayer.inventory.currentItem = slot - 36
</code></pre>
<p dir="auto">switches slots client-side.</p>
<p dir="auto">This:</p>
<pre><code class="language-t">mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(slot - 36))
</code></pre>
<p dir="auto">switches slots server-side.</p>
]]></description><link>https://forum.liquidbounce.net/post/29955</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/29955</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Sun, 17 Apr 2022 10:32:22 GMT</pubDate></item><item><title><![CDATA[Reply to How to switch hotbar slots via script? on Sun, 17 Apr 2022 10:18:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ali00035" aria-label="Profile: ali00035">@<bdi>ali00035</bdi></a> I tested it and it didnt switch the slot</p>
]]></description><link>https://forum.liquidbounce.net/post/29954</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/29954</guid><dc:creator><![CDATA[ByGraf]]></dc:creator><pubDate>Sun, 17 Apr 2022 10:18:02 GMT</pubDate></item><item><title><![CDATA[Reply to How to switch hotbar slots via script? on Sun, 17 Apr 2022 07:54:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bygraf" aria-label="Profile: bygraf">@<bdi>bygraf</bdi></a> no problem <img src="https://forum.liquidbounce.net/assets/plugins/nodebb-plugin-emoji/emoji/android/1f604.png?v=866ab33d74c" class="not-responsive emoji emoji-android emoji--smile" style="height:23px;width:auto;vertical-align:middle" title=":D" alt="😄" /></p>
]]></description><link>https://forum.liquidbounce.net/post/29950</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/29950</guid><dc:creator><![CDATA[Ali00035]]></dc:creator><pubDate>Sun, 17 Apr 2022 07:54:37 GMT</pubDate></item><item><title><![CDATA[Reply to How to switch hotbar slots via script? on Sun, 17 Apr 2022 07:53:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ali00035" aria-label="Profile: ali00035">@<bdi>ali00035</bdi></a> thank u</p>
]]></description><link>https://forum.liquidbounce.net/post/29949</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/29949</guid><dc:creator><![CDATA[ByGraf]]></dc:creator><pubDate>Sun, 17 Apr 2022 07:53:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to switch hotbar slots via script? on Sun, 17 Apr 2022 07:51:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bygraf" aria-label="Profile: bygraf">@<bdi>bygraf</bdi></a> said in <a href="/post/29946">How to switch hotbar slots via script?</a>:</p>
<blockquote>
<p dir="auto">Is there a list of things like mc.gameSettings.keyBindUseItem.pressed</p>
</blockquote>
<p dir="auto"><a href="https://scriptapi.liquidbounce.net/net/minecraft/client/settings/GameSettings.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://scriptapi.liquidbounce.net/net/minecraft/client/settings/GameSettings.html</a></p>
<blockquote>
<p dir="auto">How to switch hotbar slots via scriptapi?</p>
</blockquote>
<p dir="auto"><code>mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(slot));</code></p>
]]></description><link>https://forum.liquidbounce.net/post/29948</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/29948</guid><dc:creator><![CDATA[Ali00035]]></dc:creator><pubDate>Sun, 17 Apr 2022 07:51:58 GMT</pubDate></item></channel></rss>