Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Endermanbugzjfc/ff4f36ccfdc08c890c882fed65a65318 to your computer and use it in GitHub Desktop.
Save Endermanbugzjfc/ff4f36ccfdc08c890c882fed65a65318 to your computer and use it in GitHub Desktop.
This script allows Windows 10 users to use the 1-9 keys in their inventories to act as shortcuts to easily move items in and out of their hotbar slots.
; Hotbar Shortcuts for Minecraft Bedrock Edition by TwistedAsylumMC
; This script allows Windows 10 users to use the 1-9 keys in their inventories
; to act as shortcuts to easily move items in and out of their hotbar slots.
; How to use this script:
; 1. Download AutoHotKey (If you haven't already) from https://www.autohotkey.com/download/
; 2. Save this file to your device and double click it to start the script
; 3. Load up your Minecraft client and go inside of a world
; 4. Inside your inventory, you can use the 1-9 keys to swap items around
; 5. To close the script, locate to the corner of your screen where the time and battery is displayed,
; and click the arrow that is facing upwards, right click the green/white H and click "Exit"
; You may need to use AutoHotKey's "Window Spy" tool to get your screen's
; pixel locations of certain slots etc. The pixel locations also depend
; on the window size & if it is in full screen or not.
#IfWinActive Minecraft
1::
PixelGetColor, pixel, 850, 230, RGB ; Hacky and unreliable method of checking if they're in their inventory
if pixel != 0xC6C6C6 ; Only works with the vanilla ui colours and is screen size dependent...
{
Send {1 up}{1 down} ; Needed to make the game know about the key press
return
}
MouseGetPos, currentX, currentY ; Get position of mouse before any movement
MouseClick, left, 550, 525, 1, 0 ; Click the first slot to pick up the item there
MouseClick, left, currentX, currentY, 1, 0 ; Click the original slot to drop the item there
MouseClick, left, 550, 525, 1, 0 ; Click the first slot again to drop an item if picked up
MouseMove, currentX, currentY, 0 ; Move mouse back to it's original position
return
2::
PixelGetColor, pixel, 850, 230, RGB ; Hacky and unreliable method of checking if they're in their inventory
if pixel != 0xC6C6C6 ; Only works with the vanilla ui colours and is screen size dependent...
{
Send {2 up}{2 down} ; Needed to make the game know about the key press
return
}
MouseGetPos, currentX, currentY ; Get position of mouse before any movement
MouseClick, left, 585, 525, 1, 0 ; Click the second slot to pick up the item there
MouseClick, left, currentX, currentY, 1, 0 ; Click the original slot to drop the item there
MouseClick, left, 585, 525, 1, 0 ; Click the second slot again to drop an item if picked up
MouseMove, currentX, currentY, 0 ; Move mouse back to it's original position
return
3::
PixelGetColor, pixel, 850, 230, RGB ; Hacky and unreliable method of checking if they're in their inventory
if pixel != 0xC6C6C6 ; Only works with the vanilla ui colours and is screen size dependent...
{
Send {3 up}{3 down} ; Needed to make the game know about the key press
return
}
MouseGetPos, currentX, currentY ; Get position of mouse before any movement
MouseClick, left, 620, 525, 1, 0 ; Click the third slot to pick up the item there
MouseClick, left, currentX, currentY, 1, 0 ; Click the original slot to drop the item there
MouseClick, left, 620, 525, 1, 0 ; Click the third slot again to drop an item if picked up
MouseMove, currentX, currentY, 0 ; Move mouse back to it's original position
return
4::
PixelGetColor, pixel, 850, 230, RGB ; Hacky and unreliable method of checking if they're in their inventory
if pixel != 0xC6C6C6 ; Only works with the vanilla ui colours and is screen size dependent...
{
Send {4 up}{4 down} ; Needed to make the game know about the key press
return
}
MouseGetPos, currentX, currentY ; Get position of mouse before any movement
MouseClick, left, 655, 525, 1, 0 ; Click the fourth slot to pick up the item there
MouseClick, left, currentX, currentY, 1, 0 ; Click the original slot to drop the item there
MouseClick, left, 655, 525, 1, 0 ; Click the fourth slot again to drop an item if picked up
MouseMove, currentX, currentY, 0 ; Move mouse back to it's original position
return
5::
PixelGetColor, pixel, 850, 230, RGB ; Hacky and unreliable method of checking if they're in their inventory
if pixel != 0xC6C6C6 ; Only works with the vanilla ui colours and is screen size dependent...
{
Send {5 up}{5 down} ; Needed to make the game know about the key press
return
}
MouseGetPos, currentX, currentY ; Get position of mouse before any movement
MouseClick, left, 690, 525, 1, 0 ; Click the fifth slot to pick up the item there
MouseClick, left, currentX, currentY, 1, 0 ; Click the original slot to drop the item there
MouseClick, left, 690, 525, 1, 0 ; Click the fifth slot again to drop an item if picked up
MouseMove, currentX, currentY, 0 ; Move mouse back to it's original position
return
6::
PixelGetColor, pixel, 850, 230, RGB ; Hacky and unreliable method of checking if they're in their inventory
if pixel != 0xC6C6C6 ; Only works with the vanilla ui colours and is screen size dependent...
{
Send {6 up}{6 down} ; Needed to make the game know about the key press
return
}
MouseGetPos, currentX, currentY ; Get position of mouse before any movement
MouseClick, left, 725, 525, 1, 0 ; Click the sixth slot to pick up the item there
MouseClick, left, currentX, currentY, 1, 0 ; Click the original slot to drop the item there
MouseClick, left, 725, 525, 1, 0 ; Click the sixth slot again to drop an item if picked up
MouseMove, currentX, currentY, 0 ; Move mouse back to it's original position
return
7::
PixelGetColor, pixel, 850, 230, RGB ; Hacky and unreliable method of checking if they're in their inventory
if pixel != 0xC6C6C6 ; Only works with the vanilla ui colours and is screen size dependent...
{
Send {7 up}{7 down} ; Needed to make the game know about the key press
return
}
MouseGetPos, currentX, currentY ; Get position of mouse before any movement
MouseClick, left, 760, 525, 1, 0 ; Click the seventh slot to pick up the item there
MouseClick, left, currentX, currentY, 1, 0 ; Click the original slot to drop the item there
MouseClick, left, 760, 525, 1, 0 ; Click the seventh slot again to drop an item if picked up
MouseMove, currentX, currentY, 0 ; Move mouse back to it's original position
return
8::
PixelGetColor, pixel, 850, 230, RGB ; Hacky and unreliable method of checking if they're in their inventory
if pixel != 0xC6C6C6 ; Only works with the vanilla ui colours and is screen size dependent...
{
Send {8 up}{8 down} ; Needed to make the game know about the key press
return
}
MouseGetPos, currentX, currentY ; Get position of mouse before any movement
MouseClick, left, 795, 525, 1, 0 ; Click the eigth slot to pick up the item there
MouseClick, left, currentX, currentY, 1, 0 ; Click the original slot to drop the item there
MouseClick, left, 795, 525, 1, 0 ; Click the eigth slot again to drop an item if picked up
MouseMove, currentX, currentY, 0 ; Move mouse back to it's original position
return
9::
PixelGetColor, pixel, 850, 230, RGB ; Hacky and unreliable method of checking if they're in their inventory
if pixel != 0xC6C6C6 ; Only works with the vanilla ui colours and is screen size dependent...
{
Send {9 up}{9 down} ; Needed to make the game know about the key press
return
}
MouseGetPos, currentX, currentY ; Get position of mouse before any movement
MouseClick, left, 830, 525, 1, 0 ; Click the ninth slot to pick up the item there
MouseClick, left, currentX, currentY, 1, 0 ; Click the original slot to drop the item there
MouseClick, left, 830, 525, 1, 0 ; Click the ninth slot again to drop an item if picked up
MouseMove, currentX, currentY, 0 ; Move mouse back to it's original position
return
return
@MatheusLimaMaia
Copy link

pls, could u make a tutorial to use this script???

@Endermanbugzjfc
Copy link
Author

MatheusLimaMaia

Install AutoHotkey 1 (the old version) to run the script. But the script was written years ago, I am not sure if it still works for the latest Minecraft. For me, I just disable UI animations, hold an item and close the menu so it will automatically be placed at the first empty slot in my inventory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment