MineClone2/mods/ENTITIES/mcl_entity_invs/api.txt
cora 29d46d44af Make it possible for mods to handle inv access
i.e. ability to turn off the on_rightclick provided and call the
show_formspec function themselves
2022-09-27 05:55:18 +02:00

12 lines
608 B
Plaintext

mcl_entity_invs
===============
Inventories for your entities. It's simple. Depend on mcl_entity_invs and register your entity like so:
* mcl_entity_invs.register_inv("entity:name","Title shown in formspec",inventory_size,disable_on_righclick)
*If disable_on_righclick is true other mods can handle when to show the inventory themselves
* mcl_entity_invs.show_inv_form(entity,clicker,"Title shown in formspec")
It works by setting up a detached inventory per entity which is accessed by an id/hash generated from the entities position at creation, the progressed gametime at creation and a random salt.