Skip to content

Latest commit

 

History

History
74 lines (49 loc) · 2 KB

api.md

File metadata and controls

74 lines (49 loc) · 2 KB

Clothing API

Global callbacks

function on_update(player)

player -> player object

Called when clothing texture is updated.

Use clothing:register_on_update(fucntion) to register it.

function on_load(player, index, stack)

player -> player object index -> index in inventory stack -> ItemStack item

Called when any item from player clothing inventory is loaded. It happens when player is joined to server.

Use clothing:register_on_load(fucntion) to register it.

function on_equip(player, index, stack)

player -> player object index -> index in inventory stack -> ItemStack item

Called when any item is put into player clothing inventory.

Use clothing:register_on_equip(fucntion) to register it.

function on_unequip(player, index, stack)

player -> player object index -> index in inventory stack -> ItemStack item

Called when any item is take from player clothing inventory.

Use clothing:register_on_unequip(fucntion) to register it.

Clothes callbacks

Defined in clothes item definition stored in minetest.registered_items.

function on_load(player, index, stack)

player -> player object index -> index in inventory stack -> ItemStack item

Called when specific item is loaded into player clothing inventory. It happens when player is joined to server.

Use item_def.on_load(function) field in item definition to use this function.

function on_equip(player, index, stack)

player -> player object index -> index in inventory stack -> ItemStack item

Called when specific item is put into player clothing inventory.

Use item_def.on_equip(function) field in item definition to use this function.

function on_unequip(player, index, stack)

player -> player object index -> index in inventory stack -> ItemStack item

Called when specific item is take from player clothing inventory.

Use item_def.on_unequip(function) field in item definition to use this function.