How to switch hotbar slots via script?
-
Is there a list of things like mc.gameSettings.keyBindUseItem.pressed where i can
look up some things because i cant find anything on google and i dont always want to ask in the Forum.And i really want to become better at scripting but as already mentioned i cant find
these things i want to look up . Any tips ? -
Is there a list of things like mc.gameSettings.keyBindUseItem.pressed where i can
look up some things because i cant find anything on google and i dont always want to ask in the Forum.And i really want to become better at scripting but as already mentioned i cant find
these things i want to look up . Any tips ?@bygraf said in How to switch hotbar slots via script?:
Is there a list of things like mc.gameSettings.keyBindUseItem.pressed
https://scriptapi.liquidbounce.net/net/minecraft/client/settings/GameSettings.html
How to switch hotbar slots via scriptapi?
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(slot)); -
@bygraf said in How to switch hotbar slots via script?:
Is there a list of things like mc.gameSettings.keyBindUseItem.pressed
https://scriptapi.liquidbounce.net/net/minecraft/client/settings/GameSettings.html
How to switch hotbar slots via scriptapi?
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(slot)); -
B ByGraf has marked this topic as solved on
-
B ByGraf has marked this topic as unsolved on
-
This:
mc.thePlayer.inventory.currentItem = slot - 36switches slots client-side.
This:
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(slot - 36))switches slots server-side.
-
This:
mc.thePlayer.inventory.currentItem = slot - 36switches slots client-side.
This:
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(slot - 36))switches slots server-side.
-
This:
mc.thePlayer.inventory.currentItem = slot - 36switches slots client-side.
This:
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(slot - 36))switches slots server-side.
-
Is there a list of things like mc.gameSettings.keyBindUseItem.pressed where i can
look up some things because i cant find anything on google and i dont always want to ask in the Forum.And i really want to become better at scripting but as already mentioned i cant find
these things i want to look up . Any tips ?And this is how you should actually switch the slots on both sides.
mc.thePlayer.inventory.currentItem = x; mc.playerController.updateController();because updateController does this:
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)); } } -
Yeah, it has to be updated server-side too, because this:
mc.thePlayer.inventory.currentItemonly does it client-side. -
B ByGraf has marked this topic as solved on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login