minetest.register_allow_player_inventory_action

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

minetest.register_allow_player_inventory_action(function(player, action, inventory, inventory_info))

Description

Determinates how much of a stack may be taken, put or moved to a player inventory.

  • playerObjectRef
  • inventoryInvRef
  • action — (string), possible values are `move` `put` or `take` (same as put)
  • inventory_info — table, depending on what is supplied for action
    • action = `move`: `{from_list=string, to_list=string, from_index=number, to_index=number, count=number}`
    • action = `put` or `take`: `{listname=string, index=number, stack=ItemStack}`

Return a numeric value to limit the amount of items to be taken, put or moved. A value of `-1` for `take` will make the source stack infinite.

Example 1

Needs an example

Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox