Fix anvil may destroy items when taking output
[MineClone/MineClone2.git] / API.md
blob19590ac2c0646b3c593dc879d7ff9fcf69e9ab2e
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 All nodes can have these fields:
14 * `_mcl_hardness`: Hardness of the block, ranges from 0 to infinity (represented by -1). Determines digging times. Default: 0
15 * `_mcl_blast_resistance`: How well this block blocks and resists explosions. Default: 0
17 Use the `mcl_sounds` mod for the sounds.
19 ## APIs
20 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/`
22 ### Items
23 * Doors: `ITEMS/mcl_doors`
24 * Fences and fence gates: `ITEMS/mcl_fences`
25 * Walls: `ITEMS/mcl_walls`
26 * Beds: `ITEMS/mcl_beds`
27 * Buckets: `ITEMS/mcl_buckets`
28 * Dispenser support: `ITEMS/REDSTONE/mcl_dispensers`
30 ## Mobs
31 * Mobs: `ENTITIES/mods`
33 MineClone 2 uses Mobs Redo [`mobs`] by TenPlus1, a very powerful mod for adding mods of various types.
34 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.
35 You can add your own mobs, spawn eggs and spawning rules with this mod.
36 API documnetation is included in `ENTITIES/mobs/api.txt`.
38 ### Help
39 * Item help texts: `HELP/doc/doc_items`
40 * Low-level help entry and category framework: `HELP/doc/doc`
41 * Support for lookup tool (required for all entities): `HELP/doc/doc_identifier`
43 ### HUD
44 * Statbars: `HUD/hudbars`
46 ### Utility APIs
47 * Select random treasures: `CORE/mcl_loot`
48 * Get flowing direction of liquids: `CORE/flowlib`
49 * `on_walk_over` callback for nodes: `CORE/walkover` 
50 * Get node names close to player (to reduce constant querying): `PLAYER/mcl_playerinfo`
52 ### Unstable APIs
53 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!
55 * Panes (like glass panes and iron bars): `ITEMS/xpanes`
56 * Slabs and stairs: `ITEM/mcl_stairs` **and** `ITEMS/mcstair`
57 * `_on_ignite` callback: `ITEMS/mcl_fire`
58 * Farming: `ITEMS/mcl_farming`
59 * Anything related to redstone: Don't touch (yet)
60 * Any other mod not explicitly mentioned above
62 ### Planned APIs
64 * Flowers
65 * Saplings and trees
66 * Custom banner patterns
67 * Custom dimensions
68 * Custom portals
69 * Music discs
70 * Dispenser and dropper support
71 * Proper sky and weather APIs
72 * Explosion API