Fix naming of banner copies
[MineClone/MineClone2.git] / API.md
blob0d6c9758100ecaa1245f82e1985384768f2b2f68
1 # API
2 ## Groups
3 MineClone 2 makes very extensive use of groups. Making sure your items and objects have the correct group memberships is very important.
4 Groups are explained in `GROUPS.md`.
6 ## Mod naming convention
7 Mods mods in MineClone 2 follow a simple naming convention: Mods with the prefix “`mcl_`” are specific to MineClone 2, although they may be based on an existing standalone. Mods which lack this prefix are *usually* verbatim copies of a standalone mod. Some modifications may still have been applied, but the APIs are held compatible.
9 ## Adding items
10 ### Special fields
12 Items can have these fields:
13 * `_mcl_generate_description(itemstack)`: Required for any items which manipulate their
14    description in any way. This function takes an itemstack of its own type and must set
15    the proper advanced description for this itemstack. If you don't do this, anvils will
16    fail at properly restoring the description when their custom name gets cleared at an
17    anvil.
18    See `mcl_banners` for an example.
20 All nodes can have these fields:
22 * `_mcl_hardness`: Hardness of the block, ranges from 0 to infinity (represented by -1). Determines digging times. Default: 0
23 * `_mcl_blast_resistance`: How well this block blocks and resists explosions. Default: 0
25 Use the `mcl_sounds` mod for the sounds.
27 ## APIs
28 A lot of things are possible by using one of the APIs in the mods. Note that not all APIs are documented yet, but it is planned. The following APIs should be more or less stable but keep in mind that MineClone 2 is still unfinished. All directory names are relative to `mods/`
30 ### Items
31 * Doors: `ITEMS/mcl_doors`
32 * Fences and fence gates: `ITEMS/mcl_fences`
33 * Walls: `ITEMS/mcl_walls`
34 * Beds: `ITEMS/mcl_beds`
35 * Buckets: `ITEMS/mcl_buckets`
36 * Dispenser support: `ITEMS/REDSTONE/mcl_dispensers`
38 ## Mobs
39 * Mobs: `ENTITIES/mods`
41 MineClone 2 uses Mobs Redo [`mobs`] by TenPlus1, a very powerful mod for adding mods of various types.
42 There are modificiations from the original mod for MineClone 2 compability. Some items have been removed or moved to other mods, but the API is identical.
43 You can add your own mobs, spawn eggs and spawning rules with this mod.
44 API documnetation is included in `ENTITIES/mobs/api.txt`.
46 ### Help
47 * Item help texts: `HELP/doc/doc_items`
48 * Low-level help entry and category framework: `HELP/doc/doc`
49 * Support for lookup tool (required for all entities): `HELP/doc/doc_identifier`
51 ### HUD
52 * Statbars: `HUD/hudbars`
54 ### Utility APIs
55 * Select random treasures: `CORE/mcl_loot`
56 * Get flowing direction of liquids: `CORE/flowlib`
57 * `on_walk_over` callback for nodes: `CORE/walkover` 
58 * Get node names close to player (to reduce constant querying): `PLAYER/mcl_playerinfo`
60 ### Unstable APIs
61 The following APIs may be subject to change in future. You could already use these APIs but there will probably be breaking changes in the future, or the API is not as fleshed out as it should be. Use at your own risk!
63 * Panes (like glass panes and iron bars): `ITEMS/xpanes`
64 * Slabs and stairs: `ITEM/mcl_stairs` **and** `ITEMS/mcstair`
65 * `_on_ignite` callback: `ITEMS/mcl_fire`
66 * Farming: `ITEMS/mcl_farming`
67 * Anything related to redstone: Don't touch (yet)
68 * Any other mod not explicitly mentioned above
70 ### Planned APIs
72 * Flowers
73 * Saplings and trees
74 * Custom banner patterns
75 * Custom dimensions
76 * Custom portals
77 * Music discs
78 * Dispenser and dropper support
79 * Proper sky and weather APIs
80 * Explosion API