Switch Item Slots in Minecraft using a Command Block

Switch Item Slots in Minecraft using a Command Block - Young woman watching movie in headphones in messy room

I want to be able to set the active hotbar slot with a command instead of the mouse wheel or keyboard shortcuts (1 through 9). I don't need to move items around in the hotbar, I just need to be able to set the active slot.

I have searched for this quite a while now and haven't found anything useful yet. Can somebody please tell me how I can achieve this for a given player?



Best Answer

Actually you can't do it in Vanilla Minecraft. Selected slot is a NBT value. To change it you would use /entitydata, but the command doesn't work on players, only mobs and other entities. You can still use mods or Bukkit/Spigot Plugins, but vanilla commands won't work.




Pictures about "Switch Item Slots in Minecraft using a Command Block"

Switch Item Slots in Minecraft using a Command Block - Crop hacker silhouette typing on computer keyboard while hacking system
Switch Item Slots in Minecraft using a Command Block - Crop mother and daughter sitting on bed while using laptop
Switch Item Slots in Minecraft using a Command Block - Content female shopaholic lying on floor at home in messy room and making order in online store while using netbook



How do you switch slots in Minecraft?

In java edition you can switch slots in the inventory using KEYBINDS. For example if u had the 3rd slot binded to C and if you pressed C in a chest where blocks are it would then automatically switch those slots and the blocks would go directly to the 3rd slot of the player inventory.

How do you make a command block switch in Minecraft?

Give Multiples of Item If want to give multiple blocks at once, you need to specify an Amount in the /give command. The amount goes after the Item that you are giving. Type the command in the chat window and press the Enter key to run the command. In this example, you have specified an amount of 4 in the /give command.

How do you make a command block give you a different item?

You can use the /replaceitem command to instanty replace one item with another item. You can replace armor items worn, weapons held in your hands, items stored in chests and items in your inventory/hotbar. This is a great way to quickly put armor on a player during a Minecraft battle or change out a worn out weapon.



How To Make An Hotbar Slot Selector Machine | MINECRAFT COMMAND BLOCK TUTORIAL




More answers regarding switch Item Slots in Minecraft using a Command Block

Answer 2

There is a way of changing someones hotbar in the the new 1.8 with the /replaceitem command. Go to Here for a tutorial on the /replaceitem command. Hope this helps what your doing!

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Andrea Piacquadio, Anete Lusina, Tatiana Syrikova, Andrea Piacquadio