Represent minecraft windows
var windows=require("./")("1.8").windows;
var Item=require("prismarine-item")("1.8");
var inv=new windows.InventoryWindow(1,"inv",36);
inv.updateSlot(10,new Item(256,1));
console.log(inv.items());
"Inventory", "Chest", "Large chest", "Crafting", "Furnace", or "Trap"
Map of slot index to Item
instance.
In vanilla client, this is the item you are holding with the mouse cursor.
itemType
- numerical id that you are looking formetadata
- metadata value that you are looking for.null
means unspecified.notFull
- (optional) - iftrue
, means that the returned item should not be at itsstackSize
.
Returns how many you have in the inventory section of the window.
itemType
- numerical id that you are looking formetadata
- (optional) metadata value that you are looking for. defaults to unspecified
Returns a list of Item
instances from the inventory section of the window.
Fired whenever any slot in the window changes for any reason.
Watching bot.inventory.on("windowUpdate")
is the best way to watch for changes in your inventory.
slot
- index of changed slot.oldItem
,newItem
- either anItem
instance ornull
.
newItem === window.slots[slot]
.
Generic window that can be opened by some non-Vanilla servers and Bukkit plugins like Essentials' /invsee.
Returns how many items there are in the top section of the window.
itemType
- numerical id that you are looking formetadata
- (optional) metadata value that you are looking for. defaults to unspecified
Returns a list of Item
instances from the top section of the window.
- bump mcdata
- bump dependencies
- Import from mineflayer