5

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?

  • What have you tried already? Are you looking to just set the active slot to something else, or swap the items between two slots? Without a little more information, it's going to be hard for us to help you. – MBraedley Apr 12 '15 at 17:15
  • 1
    Im just trying to switch for example from the second slot in the hotbar to the first one without having to scroll or press 1. so I think its the first thing you mentioned. I haven't tried anything special yet because I'm not really an expert using command blocks. i didn't find a command matching what I'm searching yet. Do you need any more information? – jojonyjo Apr 12 '15 at 18:11
  • No, that should be good. I've edited your question to be a little more clear as to what you want. – MBraedley Apr 12 '15 at 19:35
  • Thank you :D Yes this is what I was trying to say / ask. – jojonyjo Apr 13 '15 at 15:33
2

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.

-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!

  • This command cannot change the active hotbar slot, only replace items. – SirBenet Apr 14 '15 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.