diff --git a/README.md b/README.md index 2d625aa4..9e959d59 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,12 @@ The game includes the mods from the default [minetest_game](https://github.com/m * [mobs_redo][] ([MIT](mods/mobs/mobs_redo/license.txt)) * mobs_aggressive/ * [creeper][] ([WTFPL][lic.creeper]) -- version [036666e Git][ver.creeper] - * ghost ([Creatures MOB-Engine][cme]) + * ghost ([Creatures MOB-Engine][cme]) -- version: [2.3.1-0-e3502a1 Git][ver.cme] * [mobs_goblins][] ([CC-BY-SA / CC-BY / CC0](mods/mobs_aggressive/mobs_goblins/README.md)) * oerrki ([Creatures MOB-Engine][cme]) * [spidermob][] ([CC-BY-SA / WTFPL / CC0](mods/mobs_aggressive/spidermob/LICENSE)) * zombie ([Creatures MOB-Engine][cme]) * mobs_passive/ - * chicken ([Creatures MOB-Engine][cme]) * sheep ([Creatures MOB-Engine][cme]) * npc/ * [peaceful_npc][] (WTFPL) @@ -144,6 +143,9 @@ The game includes the mods from the default [minetest_game](https://github.com/m * mob_shark ([CC BY-SA][lic.amp_shark]) * mob_slime ([CC0 / CC BY / CC BY-SA / CC0][lic.amp_slime]) * mob_warthog ([CC BY / CC BY-SA][lic.amp_warthog]) +* [creatures_mob_engine][cme] + * mp_cme/ + * chicken * [homedecor_modpack][homedecor] ([LGPL / WTFPL / CC BY-SA / CC0][lic.homedecor]) -- version: [02a4d14 Git][ver.homedecor] * mp_homedecor_modpack/ * building_blocks @@ -315,6 +317,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m [ver.areas]: https://github.com/ShadowNinja/areas/tree/67507c75918f8a60ad218cdcb69cc8d39e4a55ed [ver.awards]: https://github.com/minetest-mods/awards/tree/92c43d1 [ver.character_creator]: https://github.com/Rui-Minetest/character_creator/tree/5e8fec2 +[ver.cme]: https://github.com/BlockMen/cme/tree/e3502a1 [ver.creeper]: https://github.com/Rui-Minetest/creeper/tree/036666e2ccd26632a0c11585af0345c6eaa8c72d [ver.homedecor]: https://github.com/minetest-mods/homedecor_modpack/tree/02a4d14 [ver.ilights]: https://github.com/minetest-mods/ilights/tree/d5f6900b5a6510f5922a7517ad613633861ce4df diff --git a/mods/mp_cme/API.txt b/mods/mp_cme/API.txt new file mode 100644 index 00000000..d16d8e3d --- /dev/null +++ b/mods/mp_cme/API.txt @@ -0,0 +1,202 @@ +Creatures MOB-Engine API +------------------------ + +creatures.register_mob(#Creature definition) + -registers a mob at MOB-Engine; returns true when sucessfull + +creatures.rnd(chance_table) + -returns a weighted random table element; chance_sum of table must be 1 + ^ example: creatures.rnd({elem1 = {chance = 0.7}, {elem2 = {chance = 0.3}}) + +creatures.compare_pos(pos1, pos2) + -returns true if pos1 == pos2 + +creatures.findTarget(search_obj, pos, radius, search_type, mob_name, xray, no_count) + -returns table of found objects (as ObjectRef) and boolean player_near + ^ search_obj is searching object; can be nil + ^ pos is starting position for search radius + ^ radius for searching in blocks/node + ^ search_type that specifies returned object requirements + ^ "all" -- returns every object except dropped Items + ^ "hostile" -- returns every object(creature) that has hostile setting or is player + ^ ignores "mob_type" if specified + ^ "nonhostile" -- returns every object that is not hostile or player + ^ "player" -- returns all players + ^ "mates" -- returns all objects(creatures) that are of same kind + ^ requires "mob_type" specifies + ^ mob_type specifies creature that is ignored or searched, depending on search_type + ^ xray allows searching through blocks/nodes (default == false) + ^ no_count skips collecting loop and returns just the boolean player_near + ^ table is empty + +creatures.dropItems(pos, drops) + -drops items at position pos + ^ pos where to drop Items + ^ drops table in #ItemDrops format + + +#ItemDrops +---------- +{ + { + , -- e.g. "default:wood" + , -- either a or table in format {min = , max = }; optional + -- "chance = ": between 0.0 and 1.0 + }, +} + +Example: +Will drop with a chance of 30% 1 to 3 items of type "default:wood" +and with a chance of 100% 2 items of type "default:stone" +{ + {"default:wood", {min = 1, max = 3}, chance = 0.3}, + {"default:stone", 2} +} + + +#Creature definition +-------------------- +{ + name = "", -- e.g. "creatures:sheep" + stats = { + hp = 1, -- 1 HP = "1/2 player heart" + hostile = false, -- is mob hostile (required for mode "attack") + lifetime = 300, -- after which time mob despawns, in seconds + dies_when_tamed = false, -- stop despawn when tamed + can_jump = 1, -- height in nodes + can_swim = false, -- can mob swim or will it drown + can_fly = false, -- allows to fly (requires mode "fly") and disable step sounds + can_burn = false, -- takes damage of lava + can_panic = false, -- runs fast around when hit (requires mode "walk") + has_falldamage = false, -- deals damage if falling more than 3 blocks + has_kockback = false, -- get knocked back when hit + sneaky = false, -- disables step sounds + light = {min, max}, -- which light level will burn creature (requires can_burn = true) + }, + + modes = { + idle = {chance = , duration =