MineClone2/mods/ITEMS/mcl_cauldrons/API.md

28 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2021-03-17 21:47:27 +01:00
# mcl_cauldrons
This mod add an API to add cauldrons to mcl.
2021-03-18 20:50:37 +01:00
## mcl_cauldrons.is_cauldron(name)
return true if name is cauldron, false overwise.
2021-03-27 12:03:14 +01:00
## mcl_cauldrons.get_cauldron_string(type, level)
return itemstring of cauldron with <type> and <level>
e.g: `mcl_cauldrons.get_cauldron_string("water", 1) --return itemstring of a water cauldron with 1 level of water`
2021-03-18 20:58:06 +01:00
## mcl_cauldrons.take_cauldron(pos, itemstack, user, sounds)
empty cauldron at `pos`
return `bucket` field of the cauldron def if user is player, itemstack overwise.
* pos: position of the cauldron
* itemstack: will be return if `bucket` field isn't defined in cauldron def or user is nil or not player.
* user: player who takes cauldron
* sounds: sounds table. If not nil, dug sound will be played.
2021-03-18 18:02:08 +01:00
## mcl_cauldrons.register_cauldron_type(def)
def can have these fields:
2021-03-17 21:47:27 +01:00
* name: name of the liquid e.g: "water"
2021-03-18 18:02:08 +01:00
* bucket: string of the bucket item. can be nil. e.g: "mcl_buckets:bucket_water"
2021-03-17 21:47:27 +01:00
* desc: description of the item. %s will be replaced by the level. e.g: "Water Cauldron %s/3 full"
2021-03-18 18:02:08 +01:00
* texture: texture of the flowing liquid e.g: "mcl_core_water_flowing.png"
## mcl_cauldrons.registered_cauldrons
Table containing chauldrons def indexed by name.