-
Notifications
You must be signed in to change notification settings - Fork 27
Player Interface
grandmind edited this page Jun 7, 2015
·
6 revisions
The player interface allows interaction with a player's inventory. To interact with a player's inventory, a permissions card for that player must be placed inside the interface.
##Interface Functions
Function | Returns | Description |
---|---|---|
getPlayerInv(string playerName) | playerInv playerInventory | boolean success | Returns a player inventory object linked to the passed player. If the interface does not have permission for that player, it will return false. |
setOutputSide(string direction) | nil | Sets the output side of the player interface to the passed direction. (north, south, east, west) |
setInputSide(string direction) | nil | Sets the input side of the player interface to the passed direction. (north, south, east, west) |
getOutputSide() | string outputSide | Returns the output side of the player interface. (north, south, east, west) |
getInputSide() | string inputSide | Returns the input side of the player interface. (north, south, east, west) |
##Player Inventory Functions
Function | Returns | Description |
---|---|---|
getStackInSlot(number slotNum) | table itemstack | Returns a table with information about the stack in the passed slot of the player's inventory. |
retrieveFromSlot(number slotNum, number amount) | boolean success | Retrieves an itemstack from the player's inventory and puts it in the output side inventory. |
pushToSlot(number toSlot, number fromSlot, number amount) | boolean success | Pushes an itemstack to the player's inventory to the specified slot from the input side inventory. |
push(number fromSlot, number amount) | boolean success | Pushes an itemstack to the player's inventory from the input side inventory. |