Difference between revisions of "Inventory"

From Minetest Wiki
Jump to navigation Jump to search
(→‎Controls: Add new 5.8.0 shortcuts)
Line 31: Line 31:
 
If you hold an item stack and click with it somewhere outside the menu, the item stack gets thrown away into the environment.
 
If you hold an item stack and click with it somewhere outside the menu, the item stack gets thrown away into the environment.
  
===Automatic Transfer===
+
=== Shortcuts ===
  
You can automatically transfer an item stack to/from the player inventory to/from another item's inventory slot like a furnace, chest, or any other item with an inventory slot when that item's inventory is accessed. When transferring items to/from the furnace, items that can be [[smelting|smelted]] will automatically go to the input slot. Items in the furnace output slot will automatically go to the player inventory.
+
The inventory has many shortcuts for convenience. Using the mouse and the shift key, you can speed up many tasks. For example, if you hold down <kbd>Shift</kbd> while clicking on an item in the inventory, it will be moved to another relevant inventory (if available), like from the player inventory to the chest inventory or vice-versa.
  
* <kbd>Shift+Left click</kbd>: Automatically transfer item stack.
+
* <kbd>Shift+Left click</kbd>: Move item stack to other inventory (if available)
 +
* Hold down <kbd>Shift+click</kbd> while moving mouse over item slots: Continously move item stacks to other inventory (if available)
 +
* <kbd>Shift+click</kbd> on crafting output slot: [[Crafting|Craft]] and move result to inventory
 +
** <kbd>Left mouse button</kbd>: Craft as many as possible
 +
** <kbd>Mouse wheel</kbd>: Craft 10 times
 +
** <kbd>Right mouse button</kbd>: Craft once
 +
* Drag item stack on the crafting grid: Split stacks evenly
 +
* Hold down <kbd>Left mouse button</kbd> while holding an item stack and moving the cursor over the slots: Pick up items of the same type
  
 
=== Inventory debug ===
 
=== Inventory debug ===

Revision as of 11:42, 27 December 2023

Languages Language: English • Deutsch • français

An inventory is primarily used to store item stacks. There are other uses, such as crafting. An inventory consists of a rectangular grid of item slots. Each item slot can be either empty or hold one item stack. Item stacks can be moved freely between slot and slot, given that the destination slot is either empty or of the same item type.

Controls

You only use the mouse to take, drop and exchange items to move item stacks around.

Taking

You can take items from an occupied slot if the cursor holds nothing.

  • Left click: take entire item stack
  • Right click: take half from the item stack (rounding up if uneven)
  • Middle click: take 10 items from the item stack
  • Roll mouse wheel down: take 1 item from the item stack

Dropping

You can drop items onto a slot if the cursor holds 1 or more items and the slot is either empty or contains an item stack of the same item type.

  • Left click: drop entire item stack
  • Right click or roll mouse wheel up: drop 1 item of the item stack
  • Middle click: drop 10 items of the item stack

Exchanging

You can exchange items if the cursor holds 1 or more items and the destination slot is occupied by a different item type.

  • Left, middle and right click: exchange item stacks from cursor and from selected item slot

Throwing away

If you hold an item stack and click with it somewhere outside the menu, the item stack gets thrown away into the environment.

Shortcuts

The inventory has many shortcuts for convenience. Using the mouse and the shift key, you can speed up many tasks. For example, if you hold down Shift while clicking on an item in the inventory, it will be moved to another relevant inventory (if available), like from the player inventory to the chest inventory or vice-versa.

  • Shift+Left click: Move item stack to other inventory (if available)
  • Hold down Shift+click while moving mouse over item slots: Continously move item stacks to other inventory (if available)
  • Shift+click on crafting output slot: Craft and move result to inventory
    • Left mouse button: Craft as many as possible
    • Mouse wheel: Craft 10 times
    • Right mouse button: Craft once
  • Drag item stack on the crafting grid: Split stacks evenly
  • Hold down Left mouse button while holding an item stack and moving the cursor over the slots: Pick up items of the same type

Inventory debug

This is something for developers. If you press F5 when the inventory menu is open, you activate the inventory debug. The formspec elements that your cursor hovers will be highlighted. Press F5 again to disable inventory debug.

Inventories in Minetest Game

Player inventory

The player inventory.

The player inventory is in the inventory menu and has a size of 8 rows and 4 lines, providing 32 item slots of storage. It is always available. The top line makes the hotbar.

Chest and Locked Chest

Chests and locked chests both provide 8 × 4 inventories.

Bookshelf

A bookshelf has a special 8×2 inventory which can only be used for 1 book per slot.

Vessels Shelf

A vessels shelf has a special 8×2 inventory which can only be used for glass bottles and drinking glasses.

Bones

When a player dies, a bones block is generated. It has an inventory which contains all the items of the player who died. The bones’ inventory acts in many special ways, see Bones for more information.

Other inventories

Other inventories are the crafting grid and in the furnace. The crafting grid has the same properties of an inventory but you can also craft new items with it. You keep your items if you store them in the crafting grid and close the inventory menu. Even the fuel and smelting slots of the furnace are in fact just special cases of inventories which are, in this case, 1×1 inventories, even though the latter is limited to “fuel”-type items.

Inventories in other games

Other mods or games can completely customize the inventory menu to change the inventories there and also add inventories basicly whereever the modder wants to. In fact, Minetest Game just shows one possibility to use inventories.

For the purpose of this wiki, an ordinary inventory in the inventory menu is refered to as “player inventory”.