├── .gitignore ├── API.txt ├── CHANGELOG.md ├── LICENSE ├── README.md ├── bower.json ├── chicken ├── LICENSE.txt ├── README.txt ├── depends.txt ├── egg.lua ├── init.lua ├── models │ └── creatures_chicken.b3d ├── sounds │ ├── creatures_chicken.1.ogg │ ├── creatures_chicken.2.ogg │ ├── creatures_chicken.3.ogg │ ├── creatures_chicken_hit.1.ogg │ └── creatures_chicken_hit.2.ogg └── textures │ ├── creatures_chicken.png │ ├── creatures_chicken_flesh.png │ ├── creatures_chicken_meat.png │ ├── creatures_egg.png │ ├── creatures_feather.png │ └── creatures_fried_egg.png ├── creatures ├── LICENSE.txt ├── README.txt ├── common.lua ├── depends.txt ├── description.txt ├── functions.lua ├── init.lua ├── items.lua ├── register.lua ├── sounds │ ├── creatures_splash.1.ogg │ └── creatures_splash.2.ogg └── textures │ ├── creatures_flesh.png │ ├── creatures_meat.png │ ├── creatures_spawn_egg.png │ └── creatures_spawner.png ├── ghost ├── LICENSE.txt ├── README.txt ├── depends.txt ├── init.lua ├── models │ ├── creatures_ghost.b3d │ └── ghost.b3d ├── sounds │ ├── creatures_ghost.1.ogg │ ├── creatures_ghost.2.ogg │ ├── creatures_ghost_death.ogg │ └── creatures_ghost_hit.ogg └── textures │ ├── creatures_egg_ghost.png │ └── creatures_ghost.png ├── modpack.txt ├── oerrki ├── LICENSE.txt ├── README.txt ├── depends.txt ├── init.lua ├── models │ └── creatures_oerrki.b3d ├── sounds │ ├── creatures_oerrki_attack.ogg │ ├── creatures_oerrki_hit.1.ogg │ ├── creatures_oerrki_hit.2.ogg │ ├── creatures_oerrki_idle.1.ogg │ └── creatures_oerrki_idle.2.ogg └── textures │ ├── creatures_egg_oerrki.png │ └── creatures_oerrki.png ├── screenshot.png ├── sheep ├── LICENSE.txt ├── README.txt ├── depends.txt ├── init.lua ├── models │ └── creatures_sheep.b3d ├── sounds │ ├── creatures_shears.ogg │ ├── creatures_sheep.1.ogg │ ├── creatures_sheep.2.ogg │ └── creatures_sheep.3.ogg └── textures │ ├── creatures_egg_sheep.png │ ├── creatures_shears.png │ ├── creatures_sheep.png │ ├── creatures_sheep_black.png │ ├── creatures_sheep_brown.png │ ├── creatures_sheep_grey.png │ ├── creatures_sheep_shaved.png │ └── creatures_sheep_white.png └── zombie ├── LICENSE.txt ├── README.txt ├── depends.txt ├── init.lua ├── models └── creatures_zombie.b3d ├── sounds ├── creatures_zombie.1.ogg ├── creatures_zombie.2.ogg ├── creatures_zombie.3.ogg ├── creatures_zombie_death.ogg └── creatures_zombie_hit.ogg └── textures ├── creatures_egg_zombie.png ├── creatures_rotten_flesh.png └── creatures_zombie.png /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minetest-mods/mob-engine/101a517ddfadb5c028f965842a75cea7191603ed/.gitignore -------------------------------------------------------------------------------- /API.txt: -------------------------------------------------------------------------------- 1 | Creatures MOB-Engine API 2 | ------------------------ 3 | 4 | creatures.register_mob(#Creature definition) 5 | -registers a mob at MOB-Engine; returns true when sucessfull 6 | 7 | creatures.rnd(chance_table) 8 | -returns a weighted random table element; chance_sum of table must be 1 9 | ^ example: creatures.rnd({elem1 = {chance = 0.7}, {elem2 = {chance = 0.3}}) 10 | 11 | creatures.compare_pos(pos1, pos2) 12 | -returns true if pos1 == pos2 13 | 14 | creatures.findTarget(search_obj, pos, radius, search_type, mob_name, xray, no_count) 15 | -returns table of found objects (as ObjectRef) and boolean player_near 16 | ^ search_obj is searching object; can be nil 17 | ^ pos is starting position for search radius 18 | ^ radius for searching in blocks/node 19 | ^ search_type that specifies returned object requirements 20 | ^ "all" -- returns every object except dropped Items 21 | ^ "hostile" -- returns every object(creature) that has hostile setting or is player 22 | ^ ignores "mob_type" if specified 23 | ^ "nonhostile" -- returns every object that is not hostile or player 24 | ^ "player" -- returns all players 25 | ^ "mates" -- returns all objects(creatures) that are of same kind 26 | ^ requires "mob_type" specifies 27 | ^ mob_type specifies creature that is ignored or searched, depending on search_type 28 | ^ xray allows searching through blocks/nodes (default == false) 29 | ^ no_count skips collecting loop and returns just the boolean player_near 30 | ^ table is empty 31 | 32 | creatures.dropItems(pos, drops) 33 | -drops items at position pos 34 | ^ pos where to drop Items 35 | ^ drops table in #ItemDrops format 36 | 37 | 38 | #ItemDrops 39 | ---------- 40 | { 41 | { 42 | , -- e.g. "default:wood" 43 | , -- either a or table in format {min = , max = }; optional 44 | -- "chance = ": between 0.0 and 1.0 45 | }, 46 | } 47 | 48 | Example: 49 | Will drop with a chance of 30% 1 to 3 items of type "default:wood" 50 | and with a chance of 100% 2 items of type "default:stone" 51 | { 52 | {"default:wood", {min = 1, max = 3}, chance = 0.3}, 53 | {"default:stone", 2} 54 | } 55 | 56 | 57 | #Creature definition 58 | -------------------- 59 | { 60 | name = "", -- e.g. "creatures:sheep" 61 | stats = { 62 | hp = 1, -- 1 HP = "1/2 player heart" 63 | hostile = false, -- is mob hostile (required for mode "attack") 64 | lifetime = 300, -- after which time mob despawns, in seconds 65 | dies_when_tamed = false, -- stop despawn when tamed 66 | can_jump = 1, -- height in nodes 67 | can_swim = false, -- can mob swim or will it drown 68 | can_fly = false, -- allows to fly (requires mode "fly") and disable step sounds 69 | can_burn = false, -- takes damage of lava 70 | can_panic = false, -- runs fast around when hit (requires mode "walk") 71 | has_falldamage = false, -- deals damage if falling more than 3 blocks 72 | has_kockback = false, -- get knocked back when hit 73 | sneaky = false, -- disables step sounds 74 | light = {min, max}, -- which light level will burn creature (requires can_burn = true) 75 | }, 76 | 77 | modes = { 78 | idle = {chance = , duration =