Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
component:inventory_controller [2016/04/13 12:34]
shogun
component:inventory_controller [2021/05/31 17:38]
hunter3216
Line 16: Line 16:
 **Returns:​** the size of the inventory, or `nil` followed by a description why this function failed (usually `no inventory`). **Returns:​** the size of the inventory, or `nil` followed by a description why this function failed (usually `no inventory`).
 - `getStackInSlot(side:​number,​ slot:​number):​table`  ​ - `getStackInSlot(side:​number,​ slot:​number):​table`  ​
 +
 Returns a table describing the item in the specified slot or nil. Deprecated for getting info about robot'​s own inventory, see `getStackInInternalSlot`.  ​ Returns a table describing the item in the specified slot or nil. Deprecated for getting info about robot'​s own inventory, see `getStackInInternalSlot`.  ​
 **side** - must be a valid side.  ​ **side** - must be a valid side.  ​
Line 24: Line 25:
   - **size**:​number - the current stack size of the item.   - **size**:​number - the current stack size of the item.
   - **maxSize**:​number - the maximum stack size of this item.   - **maxSize**:​number - the maximum stack size of this item.
-  - **id**:​number - the Minecraft id of the item. Note that this depends on the server'​s config setting ​and can vary between servers!+  - **id**:​number - the Minecraft id of the item. Note that this field is only included if `insertIdsInConverters=true` in the configs, ​and can vary between servers!
   - **name**:​string - the **untranslated** item name, which is an internal Minecraft value like `oc:​item.FloppyDisk`   - **name**:​string - the **untranslated** item name, which is an internal Minecraft value like `oc:​item.FloppyDisk`
 +  - **label**:​string - the **translated** item name
   - **hasTag**:​boolean - whether or not the item has an NBT tag associated with it.   - **hasTag**:​boolean - whether or not the item has an NBT tag associated with it.
 - `getStackInInternalSlot(slot:​number):​table`  ​ - `getStackInInternalSlot(slot:​number):​table`  ​
Line 37: Line 39:
 Note that the robot cannot drop items into it's own inventory, attempting to do so will cause this to throw an error. You need to use `robot.transferTo` from the [[api:​robot|Robot API]] to do so. Note that the robot cannot drop items into it's own inventory, attempting to do so will cause this to throw an error. You need to use `robot.transferTo` from the [[api:​robot|Robot API]] to do so.
 - `suckFromSlot(side:​number,​ slot:​number[,​ count:​number]):​boolean`  ​ - `suckFromSlot(side:​number,​ slot:​number[,​ count:​number]):​boolean`  ​
-Takes up to count items from the specified slot of the inventory at the specified side and puts them into the currently selected slot.  ​+Takes up to count items from the specified slot of the inventory at the specified side and puts them into the currently selected ​slot. If the currently selected slot to deposit to cannot store all of the items sent to it then any remaining items are placed in the next available ​slot.  ​
 **side** - a valid side.  ​ **side** - a valid side.  ​
 **slot** - the slot to take the item from.  ​ **slot** - the slot to take the item from.  ​