turtle_storage
A turtle_storage allows you to equip a shulker or other storage items with a turtle and access its contents.
This has largely the same methods and shape as inventory, with the exception that
pullItems and pushItems transfer to/from
the turtle's inventory, rather than taking an inventory name.
Changes
- New in version 1.121.0
| size() | Get the size of this inventory. |
|---|---|
| list() | List all items in this inventory. |
| getItemDetail(slot) | Get detailed information about an item. |
| pushItems(fromSlot [, limit [, toSlot]]) | Push items from this inventory to the turtle. |
| pullItems([fromSlot [, limit [, toSlot]]]) | Pull items from the turtle into this inventory. |
- size()Source
Get the size of this inventory.
Returns
numberThe number of slots in this inventory.
- list()Source
List all items in this inventory. This returns a table, with an entry for each slot.
This returns data in the same format as
inventory.list.Returns
- {
table| nil... } Basic information about all items in this inventory.
See also
- {
- getItemDetail(slot)Source
Get detailed information about an item.
Parameters
- slot
numberThe slot to get information about.
Returns
table| nil Information about the item in this slot, ornilif it is empty.
Throws
If the slot is out of range.
See also
- slot
- pushItems(fromSlot [, limit [, toSlot]])Source
Push items from this inventory to the turtle.
Parameters
- fromSlot
numberThe slot in the current inventory to move items to. - limit?
numberThe maximum number of items to move. Defaults to the current stack limit. - toSlot?
numberThe slot in the turtle to move to. If not given, the item will be inserted into any slot.
Returns
numberThe number of transferred items.
Throws
If either source or destination slot is out of range.
- fromSlot
- pullItems([fromSlot [, limit [, toSlot]]])Source
Pull items from the turtle into this inventory.
Parameters
- fromSlot?
numberThe slot in the turtle inventory to move items from, defaults to the currently selected slot. - limit?
numberThe maximum number of items to move. Defaults to the current stack limit. - toSlot?
numberThe slot in current inventory to move to. If not given, the item will be inserted into any slot.
Returns
numberThe number of transferred items.
Throws
If either source or destination slot is out of range.
- fromSlot?