Make mob knockback weaker
[MineClone/MineClone2.git] / API.md
blob7611ce447824ace7235c8a59f78a09318819bd73
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
24 * `_mcl_after_falling(pos)`: Called after a falling node finished falling and turned into a node.
26 Use the `mcl_sounds` mod for the sounds.
28 ## APIs
29 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/`
31 ### Items
32 * Doors: `ITEMS/mcl_doors`
33 * Fences and fence gates: `ITEMS/mcl_fences`
34 * Stairs and slabs: `ITEM/mcl_stairs`
35 * Walls: `ITEMS/mcl_walls`
36 * Beds: `ITEMS/mcl_beds`
37 * Buckets: `ITEMS/mcl_buckets`
38 * Dispenser support: `ITEMS/REDSTONE/mcl_dispensers`
40 ## Mobs
41 * Mobs: `ENTITIES/mcl_mods`
43 MineClone 2 uses its own mobs framework, called “Mobs Redo: MineClone 2 Edition” or “MRM” for short.
44 This is a fork of Mobs Redo [`mobs`] by TenPlus1.
46 You can add your own mobs, spawn eggs and spawning rules with this mod.
47 API documnetation is included in `ENTITIES/mcl_mobs/api.txt`.
49 This mod includes modificiations from the original Mobs Redo. Some items have been removed or moved to other mods.
50 The API is mostly identical, but a few features have been added. Compability is not really a goal,
51 but function and attribute names of Mobs Redo 1.41 are kept.
52 If you have code for a mod which works fine under Mobs Redo, it should be easy to make it work in MineClone 2,
53 chances are good that it works out of the box.
55 ### Help
56 * Item help texts: `HELP/doc/doc_items`
57 * Low-level help entry and category framework: `HELP/doc/doc`
58 * Support for lookup tool (required for all entities): `HELP/doc/doc_identifier`
60 ### HUD
61 * Statbars: `HUD/hudbars`
63 ### Utility APIs
64 * Change player physics: `PLAYER/playerphysics`
65 * Select random treasures: `CORE/mcl_loot`
66 * Get flowing direction of liquids: `CORE/flowlib`
67 * `on_walk_over` callback for nodes: `CORE/walkover` 
68 * Get node names close to player (to reduce constant querying): `PLAYER/mcl_playerinfo`
70 ### Unstable APIs
71 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!
73 * Panes (like glass panes and iron bars): `ITEMS/xpanes`
74 * `_on_ignite` callback: `ITEMS/mcl_fire`
75 * Farming: `ITEMS/mcl_farming`
76 * Anything related to redstone: Don't touch (yet)
77 * Any other mod not explicitly mentioned above
79 ### Planned APIs
81 * Flowers
82 * Saplings and trees
83 * Custom banner patterns
84 * Custom dimensions
85 * Custom portals
86 * Music discs
87 * Dispenser and dropper support
88 * Proper sky and weather APIs
89 * Explosion API