minetest.get_inventory

From Minetest Developer Wiki
Jump to navigation Jump to search

Syntax

<source>minetest.get_inventory(location)</source>

Description

Gets an InvRef to access inventory methods.

location is a table:

  • <source enclose="none">{type="player", name="foobar"}</source>
  • <source enclose="none">{type="node", pos={x=, y=, z=}}</source>
  • <source enclose="none">{type="detached", name="creative"}</source>

Example

<source> local inv = minetest.get_inventory({type="player", name="foobar"}) </source>