Containers
Last updated
Last updated
Returns the Inventory of the bot. Note: IInventory extends from IWindow, which should be used as documentation when working with the inventory.
Gets the currently open window. Note: This can return null if no window is open.
Closes the currently open window, if no window is open then it will send an inventory close packet, however the server does not normally keep track if the inventory is open.
Gets the window by ID. Note: the bot's inventory always has the id 0, therefore if the parameter id is 0 then the bot's inventory will be returned.
Gets the window by title of the container. Note: the title must be unformatted/raw text, meaning it does not contain any color codes, or any text effects such as bold, or strikethrough.
Gets the window by type of container. The type of the window always starts with "minecraft:" and a list of container types can be found here.
The code below searches the bot's inventory for slots that have diamonds in them and then drops the slots that were found if they have less than 64 diamonds.
Methods
Events
GetInventory
onWindowAdded
GetOpenWindow
onWindowRemoved
CloseWindows
GetWindow
GetWindowByTitle
GetWindowByType