Disable villager trading again
[MineClone/MineClone2.git] / mods / ENTITIES / mobs_mc / gameconfig.md
blob8394a053c016af7430e9bdcf824e5954d9f2fe39
1 # Game integration help
3 This mod has been designed to make game integration rather easy. Ideally, it should be possible to include this mod verbatim in your game, with modifications only done by an external mod.
5 To integrate this mod in a game, you have to do 2 things: Adding the mod, and adding another mod which tells `mobs_mc` which items to use. The idea is that `mobs_mc` should work with any items. Specifically, these are the steps you need to follow:
7 * Add the `mobs_mc` mod and its dependencies
8 * Add a mod with name “`mobs_mc_gameconfig`”
9 * In this mod, do this:
10     * Do *not* depend on `mobs_mc`
11     * Create the table `mobs_mc`
12     * Create the table `mobs_mc.override`
13     * In `mobs_mc.override`, create subtables (`items`, `spawn`, etc.) like in `0_gameconfig.lua`, defining the na
14     * Read `0_gameconfig.lua` to see which items you can override (and more explanations)
15 * In `on_construct` of a pumpkin or jack'o lantern node, call:
16     * `mobs_mc.tools.check_iron_golem_summon(pos)`
17     * `mobs_mc.tools.check_snow_golem_summon(pos)`
18     * For more information, see `snowman.lua` and `iron_golem.lua`
20 Some things to note:
22 * Every override is optional, but explicitly setting all the item overrides is strongly recommended
23 * `mobs_mc` ships many (but not all) items on its own. If not item name override is set, the `mobs_mc` item is used
24     * You decide whether your game defines its own items, outside of `mobs_mc` or if you let `mobs_mc` do the work.
25 * Make sure to avoid duplicate items!
26 * After finishing this, throughly test this
27 * Without `mobs_mc_gameconfig`, the mod assumes Minetest Game items
28 * `mobs_mc` optionally depends on `mobs_mc_gameconfig`
30 ## Example `init.lua` in `mobs_mc_gameconfig`
31 ```
32 mobs_mc = {}
34 mobs_mc.override = {}
36 -- Set the item names here
37 mobs_mc.override.items = {
38         blaze_rod = "mcl_mobitems:blaze_rod",
39         blaze_powder = "mcl_mobitems:blaze_powder",
40         chicken_raw = "mcl_mobitems:chicken",
41         -- And so on ...
44 -- Set the “follow” field of mobs (used for attracting mob, feeding and breeding)
45 mobs_mc.override.follow = {
46         chicken = { "mcl_farming:wheat_seeds", "mcl_farming:melon_seeds", "mcl_farming:pumpkin_seeds", "mcl_farming:beetroot_seeds", },
47         horse = { "mcl_core:apple", mobs_mc.override.items.wheat }, -- TODO
48         pig = { "mcl_farming:potato", mobs_mc.override.items.carrot, mobs_mc.override.items.carrot_on_a_stick},
49         -- And so on ...
52 -- Custom spawn nodes
53 mobs_mc.override.spawn = {
54         snow = { "example:snow", "example:snow2" },
55         -- And so on ...
58 -- Take a look at the other possible tables, see 0_gameconfig.lua
59 ```