-
-
Notifications
You must be signed in to change notification settings - Fork 33
Inventory Class
The Inventory Class, methods are as follows:
Example: inv.getType()
returns a string representation of the inventory type.
Example: inv.getContainerTitle()
returns string of the title text of the container.
Example: inv.getMap()
returns a HashMap<String, int[]>
of the inventory mappings different depending on the type of open container/inventory (ie. python so i can make it smaller):
{
main: range(0, 27),
hotbar: range(27, 37)
}
Example: inv.getSelectedHotbarSlotIndex()
returns the index of the selected hotbar slot.
Example: inv.getSlotUnderMouse()
returns the id of the slot under the mouse.
Example: inv.getLocation(slot)
returns the part of the mapping the slot is in.
Example: inv.click(slot_number, mouse_button)
clicks a slot with a mouse button.
Example: inv.dragClick([slot1,slot2,slot3], mouse_button)
does a drag-click with a mouse button. (the slots don't have to be in order or even adjacent, but when vanilla minecraft calls the underlying function they're always sorted...)
Example: inv.closeAndDrop()
closes the inventory, (if the inventory/container is visible it will close the gui). also drops any "held on mouse" items.
Example: inv.close()
closes the inventory, and open gui if applicable.
Example: inv.quick(slot)
simulates a shift-click on a slot.
Example: inv.getHeld()
returns an ItemStackHelper of the held (by the mouse) item.
Example: inv.getSlot(slot)
returns an ItemStackHelper of the slot.
Example: inv.getTotalSlots()
returns the size of the container/inventory.
Example: inv.split(slot1, slot2)
splits the held stack into two slots. can be alternatively done with drag-click if this one has issues on some servers.
Example: inv.grabAll(slot)
does that double click on a slot thingy to move all of a type into/out-of a chest.
Example: inv.swap(slot1, slot2)
swaps the items in two slots.