Files

41 lines
899 B
Markdown

# IScriptInventory — giriş
[← IScriptInventory](index.md) · [← Master](../../wiki.md)
mchorse.mappet.api.scripts.user.items
Interface IScriptInventory
public interface IScriptInventory
This interface represents an inventory.
See IScriptPlayer.getInventory() and IScriptWorld.getInventory(int, int, int) for ways to get inventories from player
and world, respectively.
function main(c)
{
// Get player's inventory
if (c.getSubject().isPlayer())
{
var inventory = c.getSubject().getInventory();
// Do something with player's inventory
}
// Get chest's inventory in the world
if (c.getWorld().hasInventory(214, 4, 512))
{
var inventory = c.getWorld().getInventory(214, 4, 512);
// Do something with chest's inventory
}
}
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and
Type Method and Description