# acceptClick(click, gamemode)
accepts Clicks of with any mode, mouseButton and slot
Parameters
Name | Types | Description |
---|---|---|
click |
|
click object to accept |
gamemode |
|
to know when certain clicks are allowed |
# acceptCraftingClick()
# acceptInventoryClick()
# acceptNonInventorySwapAreaClick()
# acceptOutsideWindowClick()
# acceptSwapAreaLeftClick()
# acceptSwapAreaRightClick()
# clear(blockId, count)
Sets all slots in the window to null (unless specified by args)
Parameters
Name | Types | Description |
---|---|---|
blockId |
|
(optional) numerical id of the block that you would like to clear |
count |
|
(optional, requires blockId) only delete this number of the given block |
# containerCount(itemType, metadata)
Returns how many you have in the top section of the window
Parameters
Name | Types | Description |
---|---|---|
itemType |
|
numerical id that you are looking for |
metadata |
|
(optional) metadata value that you are looking for. defaults to unspecified |
# count(itemType, metadata)
Returns how many you have in the inventory section of the window
Parameters
Name | Types | Description |
---|---|---|
itemType |
|
numerical id that you are looking for |
metadata |
|
(optional) metadata value that you are looking for. defaults to unspecified |
# countRange(start, end, itemType, metadata)
Returns how many item you have of the given type, between slots start and end
Parameters
Name | Types | Description |
---|---|---|
start |
|
|
end |
|
|
itemType |
|
numerical id that you are looking for |
metadata |
|
(optional) metadata value that you are looking for. defaults to unspecified |
# dropClick()
Accepts click mode 4 with mouseButton 0 (drops one of the item) or 1 (drops all of the item)
# dropSelectedItem(untilEmpty)
Drops item held in mouse cursor
Parameters
Name | Types | Description |
---|---|---|
untilEmpty |
|
if true whole item stack will be dropped (else just one) |
# fillSlotWithItem(itemToFill, itemToTake)
Fills slot with specified item
Parameters
Name | Types | Description |
---|---|---|
itemToFill |
|
item of which the count should be increased |
itemToTake |
|
item of which the count should be decreased |
# fillSlotWithSelectedItem(item, untilFull)
Fills slot with selectedItem (the item held in mouse cursor)
Parameters
Name | Types | Description |
---|---|---|
item |
|
item of which the count should be increased |
untilFull |
|
if true as many as possible will be transfered |
# findContainerItem(itemType, metadata, notFull)
Search in the container of the window
Parameters
Name | Types | Description |
---|---|---|
itemType |
|
numerical id or name that you are looking for |
metadata |
|
metadata value that you are looking for. null means unspecified |
notFull |
|
(optional) - if true, means that the returned item should not be at its stackSize |
# findInventoryItem(itemType, metadata, notFull)
Search in the player inventory
Parameters
Name | Types | Description |
---|---|---|
itemType |
|
numerical id or name that you are looking for |
metadata |
|
metadata value that you are looking for. null means unspecified |
notFull |
|
(optional) - if true, means that the returned item should not be at its stackSize |
# findItemRange(start, end, itemType, metadata, notFull, nbt)
Returns item in the given range matching the one specified
Parameters
Name | Types | Description |
---|---|---|
start |
|
start slot to begin the search from |
end |
|
end slot to end the search |
itemType |
|
numerical id that you are looking for |
metadata |
|
metadata value that you are looking for. null means unspecified |
notFull |
|
(optional) - if true, means that the returned item should not be at its stackSize |
nbt |
|
nbt data for the item you are looking for. null means unspecified |
# findItemRangeName(start, end, itemName, metadata, notFull)
Parameters
Name | Types | Description |
---|---|---|
start |
|
start slot to begin the search from |
end |
|
end slot to end the search |
itemName |
|
name that you are looking for |
metadata |
|
metadata value that you are looking for. null means unspecified |
notFull |
|
(optional) - if true, means that the returned item should not be at its stackSize |
# findItemsRange(start, end, itemType, metadata, notFull, nbt)
Returns array of items in the given range matching the one specified
Parameters
Name | Types | Description |
---|---|---|
start |
|
start slot to begin the search from |
end |
|
end slot to end the search |
itemType |
|
numerical id that you are looking for |
metadata |
|
metadata value that you are looking for. null means unspecified |
notFull |
|
(optional) - if true, means that the returned item should not be at its stackSize |
nbt |
|
nbt data for the item you are looking for. null means unspecified |
# firstEmptyInventorySlot(hotbarFirst)
Return the id of the first empty slot in the inventory, start looking in the hotbar first if the flag is set
Parameters
Name | Types | Description |
---|---|---|
hotbarFirst |
|
DEFAULT: true |
# firstEmptySlotRange(start, end)
Return the id of the first empty slot between start and end
Parameters
Name | Types | Description |
---|---|---|
start |
|
|
end |
|
# itemsRange(start, end)
Returns a list of Item instances between slots start and end
Parameters
Name | Types | Description |
---|---|---|
start |
|
|
end |
|
# middleClick()
Accepts click mode 3 with mouseButton 2 (gets a stack of the item at the slot into the selectedItem)
# numberClick()
Accepts click mode 2 with mouseButton 0 (hotbarStart) to 8 (hotbarEnd) representing the hotbar slots
# splitSlot(item)
Splits the slot in half and holds the split in mouse cursor
Parameters
Name | Types | Description |
---|---|---|
item |
|
item to split |
# sumRange(start, end)
Returns how much items there are ignoring what the item is, between slots start and end
Parameters
Name | Types | Description |
---|---|---|
start |
|
|
end |
|
# swapSelectedItem(item)
Swaps item with the item in mouse cursor
Parameters
Name | Types | Description |
---|---|---|
item |
|
item to swap with |
# transactionRequiresConfirmation(click)
Returns the property: requiresConfirmation
Parameters
Name | Types | Description |
---|---|---|
click |
|
# tToFirst(item, start, end, lastToFirst)
Fills within specified range with given item and dumps remaining items if present and possible
Parameters
Name | Types | Description |
---|---|---|
item |
|
item used to fill slots |
start |
|
start slot to begin the search from |
end |
|
end slot to end the search |
lastToFirst |
|
if true the matching Slots will be filled from the back |
# tToFirst(slots, lastToFirst)
Fills slots with specified item
Parameters
Name | Types | Description |
---|---|---|
slots |
|
slots to fill with the item |
lastToFirst |
|
if true the matching Slots will be filled from the back |
# tToFirst(item, start, end, lastToFirst)
Searches for empty slot to dump the specified item
Parameters
Name | Types | Description |
---|---|---|
item |
|
item which should be dumped |
start |
|
start slot to begin the search from |
end |
|
end slot to end the search |
lastToFirst |
|
if true item slot will be searched from the back |
# updateSlot(slot, newItem)
Change the slot to contain the newItem. Emit the updateSlot events.
Parameters
Name | Types | Description |
---|---|---|
slot |
|
{number} |
newItem |
|
{Item} |