minetest.register allow player inventory action

Description
Determinates how much of a stack may be taken, put or moved to a player inventory.
 * — ObjectRef
 * — InvRef
 * — (string), possible values are `move` `put` or `take` (same as put)
 * — 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