- armor
Inventory armor [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- armor
uint armor [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
- armor
Slot[] armor(uint type, Slot armor)
Undocumented in source. Be warned that the author may not have intended to support it.
- boots
Slot boots [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- boots
Slot boots [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
- chestplate
Slot chestplate [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- chestplate
Slot chestplate [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
- full
Slot[] full [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- hasArmor
bool hasArmor [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- held
Slot held [@property getter]
Gets the slot the entity has in its hand.
- held
Slot held [@property setter]
Sets the slot the entity has in its hand.
- helmet
Slot helmet [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- helmet
Slot helmet [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
- hotbar
Hotbar hotbar [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- leggings
Slot leggings [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- leggings
Slot leggings [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
- length
size_t length [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- protection
uint protection [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- selected
uint selected [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- selected
uint selected [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
- opIndex
Slot[] opIndex()
- opCast
T opCast()
Gets every slots of the inventory (0..$).
This property should only be used when the full inventory is needed,
otherwise opIndex should be used for getting a slot in a specific index
or in a specific range.
- opIndex
Slot opIndex(size_t index)
Gets the slot at the given index.
- opIndex
InventoryRange opIndex(Slice slice)
Gets the slots in a specific range.
- opIndexAssign
void opIndexAssign(Slot slot, size_t index)
Sets the slot at the given index.
- opIndexAssign
void opIndexAssign(Slot slot, Slice slice)
void opIndexAssign(Slot[] slots, Slice slice)
Sets the slots in the given range.
- opSlice
Slice opSlice(size_t min, size_t max)
Undocumented in source. Be warned that the author may not have intended to support it.
- length
size_t length [@property getter]
- opDollar
size_t opDollar()
Gets the size of the inventory.
- opBinary
Inventory opBinary(Slot[] slots)
Inventory opBinary(Inventory inventory)
Inventory opBinary(Slot slot)
- opBinaryRight
Inventory opBinaryRight(Slot[] slots)
Inventory opBinaryRight(Slot slot)
Concatenates two inventories (or an inventory and an array of slots)
and returns a new one.
- opOpAssign
Slot opOpAssign(Slot slot)
Slot[] opOpAssign(Slot[] slots)
Adds slot(s) to the inventory (if there's enough space).
Note that this function will only mutate the the inventory's
slots' content without mutating its length.
- opOpAssign
uint opOpAssign(T item)
uint opOpAssign(T[] items)
Removes slot(s) from the inventory.
Parameter types:
string = tries to remove items with the same name
string[] = tries to remove items with one of the names in the array
Item = tries to remove items with the same name and properties
Slot = tries to remove items with the same name, properties and count
- opBinary
Slot* opBinary(T item)
Matches the first occurence and returns the pointer to the slot.
Paramenter types:
string = checks for an item with the same name
string[] = checks for an item with one of the names in the array
Item = checks for an item with the same name and properties (custom name, enchantments, ...)
Slot = checks for the item (see above) and the count of the item
- group
void group(size_t index)
Groups an item type into the given slot, if possible.
- opOpAssign
void opOpAssign(T number)
Performs a basic math operation on every slot's count in
the inventory, if not empty.
- empty
bool empty [@property getter]
Checks whether or not the inventory is empty.
- empty
bool empty [@property setter]
Removes every item from inventory if empty is true.
- opEquals
bool opEquals(Slot[] slots)
bool opEquals(Object object)
Compares the inventory with an array of slots.
- toString
string toString()
Returns a string with representing the inventory and its
array of slots.
Inventory held by an entity that also contains slots for armour and item's holding.