Configuration info: shop-lines: 3 # Number of shop GUI lines. Maximum is 6 (54 slots) fill-empty: true # Put items in free inventory slot instead of adding items to existing stack. 'INKSACK-3': # ItemName-Durability (-durability is optional) amount: 2 # Amount of items to add to player inventory when buy. The Inventory is where engineers store items and equip equipment and consumables. Its size can be upgraded with various milestones and research. The starting size is 16 slots, and the current maximum size is 72 slots. There is also a trash slot which will destroy any items dragged into it, except for Nuclear Waste. 1 Unlocking 2 Control 3 Item stack size 4 Upgrades 5 Hand and body slot The.
Modifier and Type | Method | Description |
---|---|---|
void | close() | |
int | convertSlot(int rawSlot) | Converts a raw slot ID into its local slot ID into whichever of the twoinventories the slot points to. |
int | countSlots() | Check the total number of slots in this view, combining the upper andlower inventories. |
abstract Inventory | getBottomInventory() | Get the lower inventory involved in this transaction. |
ItemStack | getCursor() | Get the item on the cursor of one of the viewing players. |
Inventory | getInventory(int rawSlot) | Gets the inventory corresponding to the given raw slot ID. |
ItemStack | getItem(int slot) | Gets one item in this inventory view by its raw slot ID. |
abstract HumanEntity | getPlayer() | |
InventoryType.SlotType | getSlotType(int slot) | Determine the type of the slot by its raw slot ID. |
abstract String | getTitle() | |
abstract Inventory | getTopInventory() | Get the upper inventory involved in this transaction. |
abstract InventoryType | getType() | Determine the type of inventory involved in the transaction. |
void | setCursor(ItemStack item) | Sets the item on the cursor of one of the viewing players. |
void | setItem(int slot,ItemStack item) | Sets one item in this inventory view by its raw slot ID. |
boolean | setProperty(InventoryView.Property prop,int value) | Sets an extra property of this inventory if supported by thatinventory, for example the state of a progress bar. |
Inventory
, Iterable<ItemStack>
Modifier and Type | Method | Description |
---|---|---|
ItemStack[] | getArmorContents() | |
ItemStack | getBoots() | Return the ItemStack from the boots slot |
ItemStack | getChestplate() | |
ItemStack[] | getExtraContents() | Get all additional ItemStacks stored in this inventory. |
int | getHeldItemSlot() | |
ItemStack | getHelmet() | Return the ItemStack from the helmet slot |
HumanEntity | getHolder() | Gets the block or entity belonging to the open inventory |
ItemStack | getItem(EquipmentSlot slot) | Gets the ItemStack at the given equipment slot in the inventory. |
ItemStack | getItemInHand() | Deprecated. players can duel wield now use the methods for thespecific hand instead |
ItemStack | getItemInMainHand() | Gets a copy of the item the player is currently holdingin their main hand. |
ItemStack | getItemInOffHand() | Gets a copy of the item the player is currently holdingin their off hand. |
ItemStack | getLeggings() | |
void | setArmorContents(ItemStack[] items) | Put the given ItemStacks into the armor slots |
void | setBoots(ItemStack boots) | |
void | setChestplate(ItemStack chestplate) | Put the given ItemStack into the chestplate slot. |
void | setExtraContents(ItemStack[] items) | Put the given ItemStacks into the extra slots See getExtraContents() for an explanation of extra slots. |
void | setHeldItemSlot(int slot) | |
void | setHelmet(ItemStack helmet) | Put the given ItemStack into the helmet slot. |
void | setItem(int index,ItemStack item) | Stores the ItemStack at the given index of the inventory. |
void | setItem(EquipmentSlot slot,ItemStack item) | Stores the ItemStack at the given equipment slot in the inventory. |
void | setItemInHand(ItemStack stack) | Deprecated. players can duel wield now use the methods for thespecific hand instead |
void | setItemInMainHand(ItemStack item) | Sets the item the player is holding in their main hand. |
void | setItemInOffHand(ItemStack item) | Sets the item the player is holding in their off hand. |
void | setLeggings(ItemStack leggings) |
addItem, all, all, clear, clear, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, getContents, getItem, getLocation, getMaxStackSize, getSize, getStorageContents, getType, getViewers, isEmpty, iterator, iterator, remove, remove, removeItem, setContents, setMaxStackSize, setStorageContents
forEach, spliterator
Inventory.getStorageContents()
orgetArmorContents()
Indexes 0 through 8 refer to the hotbar. 9 through 35 refer to the main inventory, counting up from 9 at the topleft corner of the inventory, moving to the right, and moving to the row below it back on the left side when itreaches the end of the row. It follows the same path in the inventory like you would read a book.
Indexes 36 through 39 refer to the armor slots. Though you can set armor with this method using these indexes,you are encouraged to use the provided methods for those slots.
Index 40 refers to the off hand (shield) item slot. Though you can set off hand with this method using this index,you are encouraged to use the provided method for this slot.
If you attempt to use this method with an index less than 0 or greater than 40, an ArrayIndexOutOfBoundsexception will be thrown.
setItem
in interface Inventory
index
- The index where to put the ItemStackitem
- The ItemStack to setArrayIndexOutOfBoundsException
- when index < 0 index > 40setBoots(ItemStack)
,setChestplate(ItemStack)
,setHelmet(ItemStack)
,setLeggings(ItemStack)
,setItemInOffHand(ItemStack)
slot
- the slot to put the ItemStackitem
- the ItemStack to setsetItem(int, ItemStack)
slot
- the slot to get the ItemStackitems
- The ItemStacks to use as armourgetExtraContents()
for an explanation of extra slots.items
- The ItemStacks to use as extrahelmet
- The ItemStack to use as helmetchestplate
- The ItemStack to use as chestplateleggings
- The ItemStack to use as leggingsboots
- The ItemStack to use as bootsitem
- The item to put into the player's handitem
- The item to put into the player's handgetItemInMainHand()
,getItemInOffHand()
stack
- The item to put into the player's handsetItemInMainHand(ItemStack)
,setItemInOffHand(ItemStack)
This validates whether the slot is between 0 and 8 inclusive.
slot
- The new slot numberIllegalArgumentException
- Thrown if slot is not between 0 and 8inclusiveInventory
getHolder
in interface Inventory