Version MFF.

This commit is contained in:
sys4-fr 2018-09-08 01:45:44 +02:00
parent 4921956b60
commit 904780573c
269 changed files with 106655 additions and 260 deletions

68
README.txt Executable file
View File

@ -0,0 +1,68 @@
-= MOBS-MOD for MINETEST =-
by PilzAdam, KrupnovPavel, Zeg9 and TenPlus1
https://forum.minetest.net/viewtopic.php?f=9&t=9917
This mod contains the following additions:
- Giant Spiders (found in desert caves, drop string when killed)
- Bee's (found around flowers, drop honey when killed, right-click to pick up, also Beehives)
- Chicken (lays eggs, added fried egg, raw & cooked chicken, right-click to pick up)
- Cow (right-click with empty bucket to get bucket of milk, feed 8 wheat to replenish milk)
- Sheep (right-click for wool, feed 8 wheat to replenish wool)
- Warthog (the local pig that gives raw and cooked port)
- Rats (right-click to pick up and place, cook for a tasty treat)
- Sand, Dirt, Stone, Tree Monsters, Oerkki and Dungeon Masters as standard
- Lava Flan, Mese Monsters added to spice things up a bit
- Cook milk in furnace to get cheese wedge, 9 wedges make 1 cheese block
..with the following new features:
- Hitting a mob has knock-back effect like in minecraft, and with blood effect
- Mobs float in water, so monsters can still chase you
- Mobs can die from falling from a height
- Mobs have better health and drops
- Hitting a mob also puts them into fight mode (apart from animals)
- Compatible with Ethereal mod, mobs now spawn on ethereal worlds
Changelog:
1.27- Added new sheep, lava flan and spawn egg textures. New Lava Pick tool smelts what you dig. New atan checking function.
1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :) also, beehive produces honey now :)
1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak.
1.24- Added feature where certain animals run away when punched (runaway = true in mob definition)
1.23- Added mob spawner block for admin to setup spawners in-game (place and right click to enter settings)
1.22- Added ability to name tamed animals and npc using nametags, also npc will attack anyone who punches them apart from owner
1.21- Added some more error checking to reduce serialize.h error and added height checks for falling off cliffs (thanks cmdskp)
1.20- Error checking added to remove bad mobs, out of map limit mobs and stop serialize.h error
1.19- Chickens now drop egg items instead of placing the egg, also throwing eggs result in 1/8 chance of spawning chick
1.18- Added docile_by_day flag so that monsters will not attack automatically during daylight hours unless hit first
1.17- Added 'dogshoot' attack type, shoots when out of reach, melee attack when in reach, also api tweaks and self.reach added
1.16- Mobs follow multiple items now, Npc's can breed
1.15- Added Feeding/Taming/Breeding function, right-click to pick up any sheep with X mark on them and replace with new one to fix compatibility.
1.14- All .self variables saved in staticdata, Fixed self.health bug
1.13- Added capture function (thanks blert2112) chance of picking up mob with hand; net; magic lasso, replaced some .x models with newer .b3d one's
1.12- Added animal ownership so that players cannot steal your tamed animals
1.11- Added flying mobs (and swimming), fly=true and fly_in="air" or "deafult:water_source" for fishy
1,10- Footstep removed (use replace), explosion routine added for exploding mobs.
1.09- reworked breeding routine, added mob rotation value, added footstep feature, added jumping mobs with sounds feature, added magic lasso for picking up animals
1.08- Mob throwing attack has been rehauled so that they can damage one another, also drops and on_die function added
1.07- Npc's can now be set to follow player or stand by using self.order and self.owner variables
beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop
1.06- Changed recovery times after breeding, and time taken to grow up (can be sped up by feeding baby animal)
1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep and lastly Jordach/BSD's kitten
1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :)
1.03- Added mob drop/replace feature so that chickens can drop eggs, cow/sheep can eat grass/wheat etc.
1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions
1.01- Mobs that suffer fall damage or die in water/lava/sunlight will now drop items
1.0 - more work on Api so that certain mobs can float in water while some sink like a brick :)
0.9 - Spawn eggs added for all mobs (admin only, cannot be placed in protected areas)... Api tweaked
0.8 - Added sounds to monster mobs (thanks Cyberpangolin for the sfx) and also chicken sound
0.7 - mobs.protected switch added to api.lua, when set to 1 mobs no longer spawn in protected areas, also bug fixes
0.6 - Api now supports multi-textured mobs, e.g oerkki, dungeon master, rats and chickens have random skins when spawning (sheep fix TODO), also new Honey block
0.5 - Mobs now float in water, die from falling, and some code improvements
0.4 - Dungeon Masters and Mese Monsters have much better aim due to shoot_offset, also they can both shoot through nodes that aren't walkable (flowers, grass etc) plus new sheep sound :)
0.3 - Added LOTT's Spider mob, made Cobwebs, added KPavel's Bee with Honey and Beehives (made texture), Warthogs now have sound and can be tamed, taming of shaved sheep or milked cow with 8 wheat so it will not despawn, many bug fixes :)
0.2 - Cooking bucket of milk into cheese now returns empty bucket
0.1 - Initial Release

389
api.lua Normal file → Executable file
View File

@ -1,6 +1,4 @@
-- Mobs Api (15th April 2016)
-- Mobs Api (4th March 2016)
mobs = {}
mobs.mod = "redo"
@ -79,8 +77,6 @@ set_animation = function(self, type)
self.animation.current = self.animation.current or ""
self.animation.speed_normal = self.animation.speed_normal or 15
if type == "stand"
and self.animation.current ~= "stand" then
@ -121,7 +117,7 @@ set_animation = function(self, type)
self.object:set_animation({
x = self.animation.run_start,
y = self.animation.run_end},
(self.animation.speed_run or self.animation.speed_normal), 0)
self.animation.speed_run, 0)
self.animation.current = "run"
end
@ -136,7 +132,7 @@ set_animation = function(self, type)
self.object:set_animation({
x = self.animation.punch_start,
y = self.animation.punch_end},
(self.animation.speed_punch or self.animation.speed_normal), 0)
self.animation.speed_normal, 0)
self.animation.current = "punch"
end
@ -172,19 +168,17 @@ function line_of_sight_water(self, pos1, pos2, stepsize)
end
-- particle effects
function effect(pos, amount, texture, max_size, radius)
radius = radius or 2
function effect(pos, amount, texture, max_size)
minetest.add_particlespawner({
amount = amount,
time = 0.25,
minpos = pos,
maxpos = pos,
minvel = {x = -radius, y = -radius, z = -radius},
maxvel = {x = radius, y = radius, z = radius},
minacc = {x = -radius, y = -radius, z = -radius},
maxacc = {x = radius, y = radius, z = radius},
minvel = {x = -0, y = -2, z = -0},
maxvel = {x = 2, y = 2, z = 2},
minacc = {x = -4, y = -4, z = -4},
maxacc = {x = 4, y = 4, z = 4},
minexptime = 0.1,
maxexptime = 1,
minsize = 0.5,
@ -221,15 +215,17 @@ end
-- check if mob is dead or only hurt
function check_for_death(self)
-- has health actually changed?
if self.health == self.old_health then
return
-- return if no change
local hp = self.object:get_hp()
if hp == self.health then
return false
end
self.old_health = self.health
-- still got some health? play hurt sound
if self.health > 0 then
if hp > 0 then
self.health = hp
if self.sounds.damage then
@ -240,11 +236,6 @@ function check_for_death(self)
})
end
-- make sure health isn't higher than max
if self.health > self.hp_max then
self.health = self.hp_max
end
update_tag(self)
return false
@ -375,7 +366,7 @@ do_env_damage = function(self)
and self.time_of_day < 0.8
and (minetest.get_node_light(pos) or 0) > 12 then
self.health = self.health - self.light_damage
self.object:set_hp(self.object:get_hp() - self.light_damage)
effect(pos, 5, "tnt_smoke.png")
end
@ -396,7 +387,7 @@ do_env_damage = function(self)
if self.water_damage ~= 0
and nodef.groups.water then
self.health = self.health - self.water_damage
self.object:set_hp(self.object:get_hp() - self.water_damage)
effect(pos, 5, "bubble.png")
end
@ -407,7 +398,7 @@ do_env_damage = function(self)
or self.standing_in == "fire:basic_flame"
or self.standing_in == "fire:permanent_flame") then
self.health = self.health - self.lava_damage
self.object:set_hp(self.object:get_hp() - self.lava_damage)
effect(pos, 5, "fire_basic_flame.png")
end
@ -456,9 +447,8 @@ do_jump = function(self)
--print ("in front:", nod.name, pos.y + 0.5)
if (minetest.registered_items[nod.name].walkable
if minetest.registered_items[nod.name].walkable
and not nod.name:find("fence")
and not nod.name:find("gate"))
or self.walk_chance == 0 then
local v = self.object:getvelocity()
@ -485,6 +475,26 @@ do_jump = function(self)
end
end
function calc_velocity(pos1, pos2, old_vel, power) --MFF we use this function
-- If the two positions are equal the vector will contain nan and crash the game
if (pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z) then
return {
x = 0,
y = 0,
z = 0
}
end
local vel = vector.direction(pos1, pos2)
vel = vector.normalize(vel)
vel = vector.multiply(vel, power)
local dist = vector.distance(pos1, pos2)
dist = math.max(dist, 1)
vel = vector.divide(vel, dist)
vel = vector.add(vel, old_vel)
return vel
end
-- this is a faster way to calculate distance
local get_distance = function(a, b)
@ -494,33 +504,27 @@ local get_distance = function(a, b)
end
-- blast damage to entities nearby (modified from TNT mod)
function entity_physics(pos, radius)
function entity_physics(pos, radius, self) --/MFF (Crabman|06/23/2015)add self to use punch function
radius = radius * 2
local objs = minetest.get_objects_inside_radius(pos, radius)
local obj_pos, dist
local obj_pos, obj_vel, dist
for _, obj in pairs(objs) do
obj_pos = obj:getpos()
dist = math.max(1, get_distance(pos, obj_pos))
local damage = math.floor((4 / dist) * radius)
local ent = obj:get_luaentity()
if obj:is_player() then
obj:set_hp(obj:get_hp() - damage)
else --if ent.health then
obj:punch(obj, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = damage},
}, nil)
end
--MFF DEBUT pumpkins
obj_vel = obj:getvelocity()
if obj_vel ~= nil then
if not (obj:get_entity_name() == "__builtin:item" and self.do_not_project_items) then
obj:setvelocity(calc_velocity(pos, obj_pos, obj_vel, radius * 10))
end
end --MFF FIN pumpkins
--dist = math.max(1, get_distance(pos, obj_pos))
--local damage = math.floor((4 / dist) * radius)
--obj:set_hp(obj:get_hp() - damage)
obj:punch(self.object, 1.0,{full_punch_interval=1.0, damage_groups = {fleshy=self.damage} })--/MFF (Crabman|06/23/2015) use punch
end
end
@ -882,13 +886,9 @@ function smart_mobs(self, s, p, dist, dtime)
end
end
mobs.spawning_mobs = {}
-- register mob function
function mobs:register_mob(name, def)
mobs.spawning_mobs[name] = true
minetest.register_entity(name, {
stepheight = def.stepheight or 0.6,
@ -938,7 +938,7 @@ minetest.register_entity(name, {
--fov = def.fov or 120,
passive = def.passive or false,
recovery_time = def.recovery_time or 0.5,
knock_back = def.knock_back or 3,
knock_back = def.knock_back or 1, --Modif MFF, default value is "or 3",
blood_amount = def.blood_amount or 5,
blood_texture = def.blood_texture or "mobs_blood.png",
shoot_offset = def.shoot_offset or 0,
@ -958,6 +958,7 @@ minetest.register_entity(name, {
health = 0,
reach = def.reach or 3,
htimer = 0,
do_not_project_items = def.do_not_project_items or false, --MFF pumpkins
child_texture = def.child_texture,
docile_by_day = def.docile_by_day or false,
time_of_day = 0.5,
@ -965,8 +966,6 @@ minetest.register_entity(name, {
runaway = def.runaway,
runaway_timer = 0,
pathfinding = def.pathfinding,
immune_to = def.immune_to or {},
explosion_radius = def.explosion_radius,
on_step = function(self, dtime)
@ -1048,8 +1047,7 @@ minetest.register_entity(name, {
if d > 5 then
--self.object:set_hp(self.object:get_hp() - math.floor(d - 5))
self.health = self.health - math.floor(d - 5)
self.object:set_hp(self.object:get_hp() - math.floor(d - 5))
effect(pos, 5, "tnt_smoke.png")
@ -1192,6 +1190,7 @@ minetest.register_entity(name, {
and self.state ~= "attack" then
local s = self.object:getpos()
local p, dist --MFF
local obj = nil
for _, oir in pairs(minetest.get_objects_inside_radius(s, self.view_range)) do
@ -1499,10 +1498,10 @@ minetest.register_entity(name, {
local dist = get_distance(p, s)
-- stop attacking if player or out of range
if dist > self.view_range
if (dist > self.view_range
or not self.attack
or not self.attack:getpos()
or self.attack:get_hp() <= 0 then
or self.attack:get_hp() <= 0) and not self.exploding then -- MFF
--print(" ** stop attacking **", dist, self.view_range)
self.state = "stand"
@ -1536,7 +1535,7 @@ minetest.register_entity(name, {
self.object:setyaw(yaw)
end
if dist > self.reach then
if dist > self.reach and not self.exploding then
if not self.v_start then
@ -1560,7 +1559,8 @@ minetest.register_entity(name, {
end
set_animation(self, "run")
else
else -- MFF(Mg|06/10/2016) #509
self.exploding = true --MFF
set_velocity(self, 0)
self.timer = self.timer + dtime
self.blinktimer = (self.blinktimer or 0) + dtime
@ -1581,10 +1581,9 @@ minetest.register_entity(name, {
if self.timer > 3 then
local pos = self.object:getpos()
local radius = self.explosion_radius or 1
-- hurt player/mobs caught in blast area
entity_physics(pos, radius)
entity_physics(pos, 3, self) --/MFF (Crabman|06/23/2015)add self to use punch function
-- dont damage anything if area protected or next to water
if minetest.find_node_near(pos, 1, {"group:water"})
@ -1608,7 +1607,7 @@ minetest.register_entity(name, {
pos.y = pos.y - 1
mobs:explosion(pos, radius, 0, 1, self.sounds.explode)
mobs:explosion(pos, 2, 0, 1, self.sounds.explode)
self.object:remove()
@ -1839,14 +1838,14 @@ minetest.register_entity(name, {
local obj = minetest.add_entity(p, self.arrow)
local ent = obj:get_luaentity()
local amount = (vec.x * vec.x + vec.y * vec.y + vec.z * vec.z) ^ 0.5
local v = ent.velocity or 1 -- or set to default
local v = ent.velocity
ent.switch = 1
-- offset makes shoot aim accurate
vec.y = vec.y + self.shoot_offset
vec.x = vec.x * (v / amount)
vec.y = vec.y * (v / amount)
vec.z = vec.z * (v / amount)
vec.x = vec.x * v / amount
vec.y = vec.y * v / amount
vec.z = vec.z * v / amount
obj:setvelocity(vec)
end
@ -1861,45 +1860,17 @@ minetest.register_entity(name, {
dir = dir or {x = 0, y = 0, z = 0}
-- weapon wear
local attach = hitter:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
hitter:set_detach() --MFF (crabman|27/7/2015) anti usebug, immortal if attached
end
local weapon = hitter:get_wielded_item()
local punch_interval = 1.4
-- calculate mob damage
local damage = 0
local armor = self.object:get_armor_groups() or {}
local tmp
-- quick error check incase it ends up 0 (serialize.h check test)
if tflp == 0 then
tflp = 0.2
end
for group,_ in pairs(tool_capabilities.damage_groups) do
tmp = tflp / (tool_capabilities.full_punch_interval or 1.4)
if tmp < 0 then
tmp = 0.0
elseif tmp > 1 then
tmp = 1.0
end
damage = damage + (tool_capabilities.damage_groups[group] or 0)
* tmp * ((armor[group] or 0) / 100.0)
end
-- check for tool immunity or special damage
for _, no in pairs(self.immune_to) do
if no[1] == weapon:get_name() then
damage = no[2] or 0
break
end
end
-- print ("Mob Damage is", damage)
-- add weapon wear
if tool_capabilities then
punch_interval = tool_capabilities.full_punch_interval or 1.4
end
@ -1927,23 +1898,11 @@ minetest.register_entity(name, {
})
end
-- do damage
self.health = self.health - math.floor(damage)
-- exit here if dead
if check_for_death(self) then
return
end
-- add healthy afterglow when hit
core.after(0.1, function()
self.object:settexturemod("^[colorize:#c9900070")
core.after(0.3, function()
self.object:settexturemod("")
end)
end)
-- blood_particles
if self.blood_amount > 0
and not disable_blood then
@ -1955,9 +1914,8 @@ minetest.register_entity(name, {
effect(pos, self.blood_amount, self.blood_texture)
end
-- knock back effect (only on full punch)
if self.knock_back > 0
and tflp > punch_interval then
-- knock back effect
if self.knock_back > 0 then
local v = self.object:getvelocity()
local r = 1.4 - math.min(punch_interval, 1.4)
@ -2119,9 +2077,9 @@ minetest.register_entity(name, {
self.path.stuck_timer = 0 -- if stuck for too long search for path
-- end init
self.object:set_armor_groups({immortal = 1, fleshy = self.armor})
self.object:set_hp(self.health)
self.object:set_armor_groups({fleshy = self.armor})
self.old_y = self.object:getpos().y
self.old_health = self.health
self.object:setyaw((math.random(0, 360) - 180) / 180 * pi)
self.sounds.distance = self.sounds.distance or 10
self.textures = textures
@ -2183,8 +2141,68 @@ end -- END mobs:register_mob function
-- global functions
mobs.spawning_mobs = {}
function mobs:spawn_special(name, nodes, neighbors, interval, chance, active_object_count) -- MFF to special mobs
mobs.spawning_mobs[name] = true
-- chance override in minetest.conf for registered mob
local new_chance = tonumber(minetest.setting_get(name .. "_chance"))
if new_chance ~= nil then
if new_chance == 0 then
return
end
chance = new_chance
end
minetest.register_abm({
nodenames = nodes,
neighbors = neighbors,
interval = interval,
chance = chance,
action = function(pos, node, _, active_object_count_wider)
-- do not spawn if too many active entities in area
local count = 0
local objs = minetest.get_objects_inside_radius(pos, 60)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil and obj:get_luaentity().name == name then
count = count + 1
end
end
if count > active_object_count then
return
end
-- spawn above node
pos.y = pos.y + 1
-- only spawn away from player
local objs = minetest.get_objects_inside_radius(pos, 10)
for _,oir in pairs(objs) do
if oir:is_player() then
return
end
end
-- are we spawning inside solid nodes?
if minetest.registered_nodes[node_ok(pos).name].walkable == true then
return
end
pos.y = pos.y + 1
if minetest.registered_nodes[node_ok(pos).name].walkable == true then
return
end
-- spawn mob half block higher than ground
pos.y = pos.y - 0.5
minetest.add_entity(pos, name)
end
})
end
function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
interval, chance, active_object_count, min_height, max_height, day_toggle)
interval, chance, active_object_count, min_height, max_height, spawn_in_area, day_toggle) --MFF crabman "spawn_in_area"
mobs.spawning_mobs[name] = true
-- chance override in minetest.conf for registered mob
local new_chance = tonumber(minetest.setting_get(name .. "_chance"))
@ -2192,7 +2210,7 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
if new_chance ~= nil then
if new_chance == 0 then
print("[Mobs Redo] " .. name .. " has spawning disabled")
--print("[Mobs Redo] " .. name .. " has spawning disabled")
return
end
@ -2209,11 +2227,12 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
interval = interval,
chance = chance,
action = function(pos, node, aoc, active_object_count_wider)
action = function(pos, node, _, active_object_count_wider)
-- do not spawn if too many active entities in area
if active_object_count_wider > active_object_count
or not mobs.spawning_mobs[name] then
or not mobs.spawning_mobs[name]
or not pos then --MFF fix crash
return
end
@ -2250,7 +2269,8 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
-- mobs cannot spawn in protected areas when enabled
if spawn_protected == 1
and minetest.is_protected(pos, "") then
and minetest.is_protected(pos, "")
and not spawn_in_area then --MFF crabman
return
end
@ -2294,10 +2314,10 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
end
-- compatibility with older mob registration
function mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height, day_toggle)
function mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height, spawn_in_area, day_toggle)
mobs:spawn_specific(name, nodes, {"air"}, min_light, max_light, 30,
chance, active_object_count, -31000, max_height, day_toggle)
chance, active_object_count, -31000, max_height, spawn_in_area, day_toggle)
end
-- set content id's
@ -2349,7 +2369,8 @@ function mobs:explosion(pos, radius, fire, smoke, sound)
p.y = pos.y + y
p.z = pos.z + z
if (x * x) + (y * y) + (z * z) <= (radius * radius) + pr:next(-radius, radius)
if p.y >= -19600 --MFF
and(x * x) + (y * y) + (z * z) <= (radius * radius) + pr:next(-radius, radius)
and data[vi] ~= c_air
and data[vi] ~= c_ignore
and data[vi] ~= c_obsidian
@ -2360,8 +2381,48 @@ function mobs:explosion(pos, radius, fire, smoke, sound)
local on_blast = minetest.registered_nodes[n].on_blast
if on_blast then
return on_blast(p)
else
local drops = on_blast(p) or {} -- MFF(Lymkwi) : Chests and bones return their drops now
for _, name in ipairs(drops) do
local obj = minetest.add_item(p, ItemStack(name))
if obj then
obj:setvelocity({
x = math.random(-2, 2),
y = 7,
z = math.random(-2, 2)
})
end
end
return
end
if not minetest.is_protected(p, "") --/MFF (Crabman|06/23/2015) re-added node protected in areas
and minetest.get_item_group(n, "unbreakable") ~= 1
and minetest.get_item_group(n, "nether") == 0 then
-- if chest then drop items inside
if n == "default:chest"
or n == "3dchest:chest"
or n == "bones:bones" then
local meta = minetest.get_meta(p)
local inv = meta:get_inventory()
for i = 1, inv:get_size("main") do
local m_stack = inv:get_stack("main", i)
local obj = minetest.add_item(p, m_stack)
if obj then
obj:setvelocity({
x = math.random(-2, 2),
y = 7,
z = math.random(-2, 2)
})
end
end
end
-- after effects
if fire > 0
and (minetest.registered_nodes[n].groups.flammable
@ -2420,13 +2481,6 @@ function mobs:register_arrow(name, def)
return
end
-- does arrow have a tail (fireball)
if def.tail
and def.tail == 1
and def.tail_texture then
effect(pos, 1, def.tail_texture, 10, 0)
end
if self.hit_node then
local node = node_ok(pos).name
@ -2488,30 +2542,20 @@ function mobs:register_arrow(name, def)
end
-- Spawn Egg
function mobs:register_egg(mob, desc, background, addegg, no_creative)
local grp = {}
-- do NOT add this egg to creative inventory (e.g. dungeon master)
if creative and no_creative == true then
grp = {not_in_creative_inventory = 1}
end
function mobs:register_egg(mob, desc, background, addegg)
local invimg = background
if addegg == 1 then
invimg = "mobs_chicken_egg.png^(" .. invimg ..
"^[mask:mobs_chicken_egg_overlay.png)"
invimg = invimg .. "^mobs_egg_inv.png" -- MFF
end
minetest.register_craftitem(mob, {
description = desc,
inventory_image = invimg,
groups = grp,
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
if pos
@ -2523,11 +2567,6 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
local mob = minetest.add_entity(pos, mob)
local ent = mob:get_luaentity()
if not ent then
mob:remove()
return
end
if ent.type ~= "monster" then
-- set owner and tame if not monster
ent.owner = placer:get_player_name()
@ -2774,41 +2813,3 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
end)
-- used to drop items inside a chest or container
local drop_items = function(pos, invstring)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
for i = 1, inv:get_size(invstring) do
local m_stack = inv:get_stack(invstring, i)
local obj = minetest.add_item(pos, m_stack)
if obj then
obj:setvelocity({
x = math.random(-10, 10) / 9,
y = 3,
z = math.random(-10, 10) / 9
})
end
end
end
-- override chest node so it drops items on explode
minetest.override_item("default:chest", {
on_blast = function(p)
minetest.after(0, function()
drop_items(p, "main")
minetest.remove_node(p)
end)
end,
})

190
bee.lua Executable file
View File

@ -0,0 +1,190 @@
-- Bee by KrupnoPavel
mobs:register_mob("mobs:bee", {
-- animal, monster, npc, barbarian
type = "animal",
-- it is aggressive
passive = true,
-- health & armor
hp_min = 1,
hp_max = 2,
armor = 200,
-- textures and model
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.2, 0.2},
visual = "mesh",
mesh = "mobs_bee.x",
textures = {
{"mobs_bee.png"},
},
-- sounds
makes_footstep_sound = false,
sounds = {
random = "mobs_bee",
},
walk_velocity = 1,
jump = true,
-- drops honey when killed
drops = {
{name = "mobs:honey", chance = 1, min = 1, max = 2},
},
-- damage
water_damage = 1,
lava_damage = 1,
light_damage = 0,
fall_damage = 0,
fall_speed = -3,
-- model animation
animation = {
speed_normal = 15,
stand_start = 0,
stand_end = 30,
walk_start = 35,
walk_end = 65,
},
-- right click to pick up bee
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, 25, 80, 0, true, nil)
end,
})
-- spawn on group:flowers between 4 and 20 light, 1 in 8000 chance, 1 bee in area up to 31000 in height
mobs:spawn_specific("mobs:bee", {"group:flower"}, {"air"}, 4, 20, 30, 8000, 2, -31000, 31000, true, true)
-- register spawn egg
mobs:register_egg("mobs:bee", "Bee", "mobs_bee_inv.png", 1)
-- honey
minetest.register_craftitem("mobs:honey", {
description = "Honey",
inventory_image = "mobs_honey_inv.png",
on_use = minetest.item_eat(6),
})
-- beehive (when placed spawns bee)
minetest.register_node("mobs:beehive", {
description = "Beehive",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"mobs_beehive.png"},
inventory_image = "mobs_beehive.png",
paramtype = "light",
sunlight_propagates = true,
walkable = true,
groups = {fleshy=3,dig_immediate=3},
on_use = minetest.item_eat(4),
sounds = default.node_sound_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "size[8,6]"
..default.gui_bg..default.gui_bg_img..default.gui_slots
.. "image[3,0.8;0.8,0.8;mobs_bee_inv.png]"
.. "list[current_name;beehive;4,0.5;1,1;]"
.. "list[current_player;main;0,2.35;8,4;]"
.. "listring[]")
meta:get_inventory():set_size("beehive", 1)
end,
after_place_node = function(pos, placer, itemstack)
if placer:is_player() then
minetest.set_node(pos, {name = "mobs:beehive", param2 = 1})
if math.random(1, 5) == 1 then
minetest.add_entity(pos, "mobs:bee")
end
end
end,
on_punch = function(pos, node, puncher)
-- yep, bee's don't like having their home punched by players
puncher:set_hp(puncher:get_hp() - 4)
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if listname == "beehive" then
return 0
end
return stack:get_count()
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos)
-- only dig beehive if no honey inside
return meta:get_inventory():is_empty("beehive")
end,
})
minetest.register_craft({
output = "mobs:beehive",
recipe = {
{"mobs:bee","mobs:bee","mobs:bee"},
}
})
-- honey block
minetest.register_node("mobs:honey_block", {
description = "Honey Block",
tiles = {"mobs_honey_block.png"},
groups = {snappy = 3, flammable = 2},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_craft({
output = "mobs:honey_block",
recipe = {
{"mobs:honey", "mobs:honey", "mobs:honey"},
{"mobs:honey", "mobs:honey", "mobs:honey"},
{"mobs:honey", "mobs:honey", "mobs:honey"},
}
})
minetest.register_craft({
output = "mobs:honey 9",
recipe = {
{"mobs:honey_block"},
}
})
-- beehive workings
minetest.register_abm({
nodenames = {"mobs:beehive"},
interval = 6,
chance = 5,
catch_up = false,
action = function(pos, node)
-- bee's only make honey during the day
local tod = (minetest.get_timeofday() or 0) * 24000
if tod < 4500 or tod > 19500 then
return
end
-- find flowers in area around hive
local flowers = minetest.find_nodes_in_area_under_air(
{x = pos.x - 10, y = pos.y - 5, z = pos.z - 10},
{x = pos.x + 10, y = pos.y + 5, z = pos.z + 10},
"group:flower")
-- no flowers no honey, nuff said!
if #flowers > 3 then
local meta = minetest.get_meta(pos)
-- error check just incase it's an old beehive
if meta then
meta:get_inventory():add_item("beehive", "mobs:honey")
end
end
end
})

93
bunny.lua Executable file
View File

@ -0,0 +1,93 @@
-- Bunny by ExeterDad
mobs:register_mob("mobs:bunny", {
-- animal, monster, npc
type = "animal",
-- is it aggressive
passive = true,
reach = 1,
-- health & armor
hp_min = 3,
hp_max = 6,
armor = 200,
-- textures and model
collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268},
visual = "mesh",
mesh = "mobs_bunny.b3d",
drawtype = "front",
textures = {
{"mobs_bunny_grey.png"},
{"mobs_bunny_brown.png"},
{"mobs_bunny_white.png"},
},
-- sounds
sounds = {},
makes_footstep_sound = false,
-- speed and jump
walk_velocity = 1,
run_velocity = 2,
runaway = true,
jump = true,
-- drops meat when dead
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2},
},
-- damaged by
water_damage = 1,
lava_damage = 4,
light_damage = 0,
fear_height = 2,
-- model animation
animation = {
speed_normal = 15,
stand_start = 1,
stand_end = 15,
walk_start = 16,
walk_end = 24,
punch_start = 16,
punch_end = 24,
},
-- follows carrot from farming redo
follow = {"farming:carrot", "farming_plus:carrot_item"},
view_range = 8,
-- eat carrots
replace_rate = 10,
replace_what = {"farming:carrot_7", "farming:carrot_8", "farming_plus:carrot"},
replace_with = "air",
-- right click to pick up rabbit
on_rightclick = function(self, clicker)
-- feed or tame
if mobs:feed_tame(self, clicker, 4, true, true) then
return
end
-- Monty Python tribute
local item = clicker:get_wielded_item()
if item:get_name() == "mobs:lava_orb" then
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
self.object:set_properties({
textures = {"mobs_bunny_evil.png"},
})
self.type = "monster"
self.object:set_hp(20)
return
end
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
end,
attack_type = "dogfight",
damage = 5,
})
mobs:spawn_specific("mobs:bunny", {"default:dirt_with_grass"}, {"air"}, 8, 20, 30, 15000, 2, -31000, 31000, true, true)
mobs:register_egg("mobs:bunny", "Bunny", "mobs_bunny_inv.png", 1)

261
chicken.lua Executable file
View File

@ -0,0 +1,261 @@
-- Chicken by JK Murray
mobs:register_mob("mobs:chicken", {
-- animal, monster, npc, barbarian
type = "animal",
-- is it aggressive
passive = true,
-- health & armor
hp_min = 4,
hp_max = 8,
armor = 200,
-- textures and model
collisionbox = {-0.3, -0.75, -0.3, 0.3, 0.1, 0.3},
visual = "mesh",
mesh = "mobs_chicken.x",
-- seems a lot of textures but this fixes the problem with the model
textures = {
{"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png",
"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png"},
{"mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png",
"mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png"},
},
child_texture = {
{"mobs_chick.png", "mobs_chick.png", "mobs_chick.png", "mobs_chick.png",
"mobs_chick.png", "mobs_chick.png", "mobs_chick.png", "mobs_chick.png", "mobs_chick.png"},
},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_chicken",
},
-- speed and jump
walk_velocity = 1,
run_velocity = 2,
runaway = true,
jump = true,
-- drops raw chicken when dead
drops = {
{name = "mobs:chicken_raw", chance = 1, min = 2, max = 2},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 0,
fall_damage = 0,
fall_speed = -8,
fear_height = 5,
-- model animation
animation = {
speed_normal = 15,
stand_start = 0,
stand_end = 1, -- 20
walk_start = 20,
walk_end = 40,
},
-- follows wheat
follow = {"farming:seed_wheat", "farming:seed_cotton"},
view_range = 5,
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
end,
do_custom = function(self)
if not self.child
and math.random(1, 500) == 1 then
local pos = self.object:getpos()
minetest.add_item(pos, "mobs:egg")
minetest.sound_play("default_place_node_hard", {
pos = pos,
gain = 1.0,
max_hear_distance = 5,
})
end
end,
})
-- spawn on default or bamboo grass between 8 and 20 light, 1 in 15000 change, 1 chicken in area up to 31000 in height
mobs:spawn_specific("mobs:chicken", {"default:dirt_with_grass"}, {"air"}, 8, 20, 30, 15000, 2, -31000, 31000, true, true)
-- register spawn egg
mobs:register_egg("mobs:chicken", "Chicken", "mobs_chicken_inv.png", 1)
-- egg entity
mobs:register_arrow("mobs:egg_entity", {
visual = "sprite",
visual_size = {x=.5, y=.5},
textures = {"mobs_chicken_egg.png"},
velocity = 6,
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 1},
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 1},
}, nil)
end,
hit_node = function(self, pos, node)
local num = math.random(1, 10)
if num == 1 then
pos.y = pos.y + 1
local nod = minetest.get_node_or_nil(pos)
if not nod
or not minetest.registered_nodes[nod.name]
or minetest.registered_nodes[nod.name].walkable == true then
return
end
local mob = minetest.add_entity(pos, "mobs:chicken")
local ent2 = mob:get_luaentity()
mob:set_properties({
textures = ent2.child_texture[1],
visual_size = {
x = ent2.base_size.x / 2,
y = ent2.base_size.y / 2
},
collisionbox = {
ent2.base_colbox[1] / 2,
ent2.base_colbox[2] / 2,
ent2.base_colbox[3] / 2,
ent2.base_colbox[4] / 2,
ent2.base_colbox[5] / 2,
ent2.base_colbox[6] / 2
},
})
ent2.child = true
ent2.tamed = true
ent2.owner = self.playername
end
end
})
-- egg throwing item
local egg_GRAVITY = 9
local egg_VELOCITY = 19
-- shoot egg
local mobs_shoot_egg = function (item, player, pointed_thing)
local playerpos = player:getpos()
minetest.sound_play("default_place_node_hard", {
pos = playerpos,
gain = 1.0,
max_hear_distance = 5,
})
local obj = minetest.add_entity({
x = playerpos.x,
y = playerpos.y +1.5,
z = playerpos.z
}, "mobs:egg_entity")
local ent = obj:get_luaentity()
local dir = player:get_look_dir()
ent.velocity = egg_VELOCITY -- needed for api internal timing
ent.switch = 1 -- needed so that egg doesn't despawn straight away
obj:setvelocity({
x = dir.x * egg_VELOCITY,
y = dir.y * egg_VELOCITY,
z = dir.z * egg_VELOCITY
})
obj:setacceleration({
x = dir.x * -3,
y = -egg_GRAVITY,
z = dir.z * -3
})
-- pass player name to egg for chick ownership
local ent2 = obj:get_luaentity()
ent2.playername = player:get_player_name()
item:take_item()
return item
end
-- egg
minetest.register_node("mobs:egg", {
description = "Chicken Egg",
tiles = {"mobs_chicken_egg.png"},
inventory_image = "mobs_chicken_egg.png",
visual_scale = 0.7,
drawtype = "plantlike",
wield_image = "mobs_chicken_egg.png",
paramtype = "light",
walkable = false,
is_ground_content = true,
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
},
groups = {snappy = 2, dig_immediate = 3},
after_place_node = function(pos, placer, itemstack)
if placer:is_player() then
minetest.set_node(pos, {name = "mobs:egg", param2 = 1})
end
end,
on_use = mobs_shoot_egg
})
-- fried egg
minetest.register_craftitem("mobs:chicken_egg_fried", {
description = "Fried Egg",
inventory_image = "mobs_chicken_egg_fried.png",
on_use = minetest.item_eat(2),
})
minetest.register_craft({
type = "cooking",
recipe = "mobs:egg",
output = "mobs:chicken_egg_fried",
})
-- raw chicken
minetest.register_craftitem("mobs:chicken_raw", {
description = "Raw Chicken",
inventory_image = "mobs_chicken_raw.png",
on_use = minetest.item_eat(2),
})
-- cooked chicken
minetest.register_craftitem("mobs:chicken_cooked", {
description = "Cooked Chicken",
inventory_image = "mobs_chicken_cooked.png",
on_use = minetest.item_eat(4), -- Modif MFF
})
minetest.register_craft({
type = "cooking",
recipe = "mobs:chicken_raw",
output = "mobs:chicken_cooked",
})

193
cow.lua Executable file
View File

@ -0,0 +1,193 @@
-- Cow by Krupnovpavel
mobs:register_mob("mobs:cow", {
-- animal, monster, npc, barbarian
type = "animal",
-- aggressive, does 5 damage to player when threatened
passive = false,
group_attack = true,
attack_type = "dogfight",
reach = 2,
damage = 4,
-- health & armor
hp_min = 15,
hp_max = 20,
armor = 200,
-- textures and model
collisionbox = {-0.8, 0, -0.8, 0.8, 1.6, 0.8}, --Modif MFF (debug)
visual = "mesh",
mesh = "mobs_cow.b3d",
textures = {
{"mobs_cow_lightbrown.png"},
{"mobs_cow_brown.png"},
{"mobs_cow_white.png"},
},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_cow",
},
-- speed and jump
walk_velocity = 1,
run_velocity = 2,
jump = true,
-- drops raw meat when dead
drops = {
{name = "mobs:meat_raw", chance = 1, min = 5, max = 10},
{name = "mobs:leather", chance = 1, min = 0, max = 3},
{name = "maptools:silver_coin", chance = 10, min = 1, max = 1,},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 0,
-- model animation
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 30,
walk_start = 35,
walk_end = 65,
run_start = 105,
run_end = 135,
punch_start = 70,
punch_end = 100,
},
follow = "farming:wheat",
view_range = 7,
replace_rate = 100,
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
replace_with = "mobs:dung",
fear_height = 2,
on_rightclick = function(self, clicker)
-- feed or tame
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
local tool = clicker:get_wielded_item()
-- milk cow with empty bucket
if tool:get_name() == "bucket:bucket_empty" then
--if self.gotten == true
if self.child == true then
return
end
if self.gotten == true then
minetest.chat_send_player(clicker:get_player_name(),
"Cow already milked!")
return
end
local inv = clicker:get_inventory()
inv:remove_item("main", "bucket:bucket_empty")
if inv:room_for_item("main", {name = "mobs:bucket_milk"}) then
clicker:get_inventory():add_item("main", "mobs:bucket_milk")
else
local pos = self.object:getpos()
pos.y = pos.y + 0.5
minetest.add_item(pos, {name = "mobs:bucket_milk"})
end
self.gotten = true -- milked
return
end
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end,
})
-- spawn on default;green;prairie grass between 0 and 20 light, 1 in 15000 chance, 1 cow in area up to 31000 in height
mobs:spawn_specific("mobs:cow", {"default:dirt_with_grass"}, {"air"}, 8, 20, 30, 15000, 2, -31000, 31000, true, true)
-- register spawn egg
mobs:register_egg("mobs:cow", "Cow", "mobs_cow_inv.png", 1)
-- leather
minetest.register_craftitem("mobs:leather", {
description = "Leather",
inventory_image = "mobs_leather.png",
})
-- bucket of milk
minetest.register_craftitem("mobs:bucket_milk", {
description = "Bucket of Milk",
inventory_image = "mobs_bucket_milk.png",
stack_max = 1,
on_use = minetest.item_eat(8, 'bucket:bucket_empty'),
})
-- cheese wedge
minetest.register_craftitem("mobs:cheese", {
description = "Cheese",
inventory_image = "mobs_cheese.png",
on_use = minetest.item_eat(4),
})
minetest.register_craft({
type = "cooking",
output = "mobs:cheese",
recipe = "mobs:bucket_milk",
cooktime = 5,
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
})
-- cheese block
minetest.register_node("mobs:cheeseblock", {
description = "Cheese Block",
tiles = {"mobs_cheeseblock.png"},
is_ground_content = false,
groups = {crumbly = 3},
sounds = default.node_sound_dirt_defaults()
})
minetest.register_craft({
output = "mobs:cheeseblock",
recipe = {
{'mobs:cheese', 'mobs:cheese', 'mobs:cheese'},
{'mobs:cheese', 'mobs:cheese', 'mobs:cheese'},
{'mobs:cheese', 'mobs:cheese', 'mobs:cheese'},
}
})
minetest.register_craft({
output = "mobs:cheese 9",
recipe = {
{'mobs:cheeseblock'},
}
})
-- Dung (from factory's fertilizer)
minetest.register_node("mobs:dung", {
tiles = {"default_dirt.png"},
inventory_image = "mobs_dung.png",
description = "Cow dung",
drawtype = "nodebox",
paramtype = "light",
is_ground_content = true,
groups = {snappy = 3, attached_node = 1},
node_box = {
type = "fixed",
fixed = {
{-0.1875, -0.5, -0.1875, 0.1875, -0.4375, 0.1875},
{-0.125, -0.4375, -0.125, 0.125, -0.375, 0.125},
{0, -0.375, -0.0625, 0.0625, -0.3125, 0.0625},
{0, -0.3125, -0.0625, 0.0625, -0.25, 0},
{-0.0625, -0.375, -0.0625, 0, -0.3125, 0},
}
}
})
minetest.register_craft({
type = "fuel",
recipe = "mobs:dung",
burntime = "8",
})

3
crafts.lua Normal file → Executable file
View File

@ -1,4 +1,3 @@
-- nametag
minetest.register_craftitem("mobs:nametag", {
description = "Nametag",
@ -80,4 +79,4 @@ minetest.register_craft({
{'', 'default:steel_ingot', ''},
{'', 'group:stick', 'default:steel_ingot'},
}
})
})

62
creeper.lua Executable file
View File

@ -0,0 +1,62 @@
-- Creeper by Davedevils (from his subgame MineClone)
mobs:register_mob("mobs:creeper", {
-- animal, monster, npc, barbarian
type = "monster",
-- agressive, does 21 damage to player when explode
passive = false,
attack_type = "explode",
pathfinding = false,
damage = 21,
-- health & armor
hp_min = 30, hp_max = 40, armor = 100,
-- textures and model
collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
visual = "mesh",
mesh = "mobs_tree_monster.b3d",
drawtype = "front",
textures = {
{"mobs_creeper.png"},
},
blood_texture = "mobs_creeper_inv.png",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_treemonster",
explode= "tnt_explode",
},
-- speed and jump
walk_velocity = 1,
run_velocity = 2.5,
jump = true,
view_range = 16,
-- drops mese or diamond when dead
drops = {
{name = "default:torch",
chance = 10, min = 3, max = 5,},
{name = "default:iron_lump",
chance = 5, min = 1, max = 2,},
{name = "default:coal_lump",
chance = 3, min = 1, max = 3,},
},
-- damaged by
water_damage = 2,
lava_damage = 15,
light_damage = 0,
-- model animation
animation = {
stand_start = 0,
stand_end = 24,
walk_start = 25,
walk_end = 47,
run_start = 48,
run_end = 62,
punch_start = 48,
punch_end = 62,
speed_normal = 15,
speed_run = 15,
},
})
mobs:spawn_specific("mobs:creeper", {"default:dirt_with_grass"}, {"air"}, 8, 20, 30, 25000, 1, -31000, 31000, false)
mobs:register_egg("mobs:creeper", "Creeper", "mobs_creeper_inv.png", 1)

2
depends.txt Normal file → Executable file
View File

@ -1 +1,3 @@
default
mesecons_materials?
unified_inventory?

View File

@ -1 +0,0 @@
Adds a mob api for mods to add animals or monsters etc

72
dirtmonster.lua Executable file
View File

@ -0,0 +1,72 @@
-- Dirt Monster by PilzAdam
mobs:register_mob("mobs:dirt_monster", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 6 damage to player when hit
passive = false,
attack_type = "dogfight",
pathfinding = false,
reach = 2,
damage = 5,
-- health & armor
hp_min = 25,
hp_max = 30,
armor = 100,
-- textures and model
collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
visual = "mesh",
mesh = "mobs_stone_monster.b3d",
textures = {
{"mobs_dirt_monster.png"},
},
blood_texture = "default_dirt.png",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_dirtmonster",
},
-- speed and jump
view_range = 16,
walk_velocity = 1.5,
run_velocity = 3,
jump = true,
-- drops dirt and coins when dead
drops = {
{name = "default:dirt", chance = 1, min = 3, max = 5,},
{name = "maptools:silver_coin", chance = 2, min = 1, max = 1,},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 2,
fear_height = 4,
-- model animation
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 14,
walk_start = 15,
walk_end = 38,
run_start = 40,
run_end = 63,
punch_start = 40,
punch_end = 63,
},
})
-- spawn on dirt_with_grass and drygrass between -1 and 5 light, 1 in 12500 change, 1 dirt monster in area up to 31000 in height
mobs:spawn_specific("mobs:dirt_monster", {"default:dirt_with_grass", "default:dirt_with_dry_grass"}, {"air"}, -1, 5, 30, 12500, 1, -31000, 31000, false, false)
-- register spawn egg
mobs:register_egg("mobs:dirt_monster", "Dirt Monster", "mobs_dirt_monster_inv.png", 1)
minetest.register_craft({
output = "mobs:dirt_monster",
recipe = {
{"default:dirt", "default:dirt", "default:dirt"},
{"default:dirt", "default:nyancat_rainbow", "default:dirt"},
{"default:dirt", "default:dirt", "default:dirt"}
}
})

89
dog.lua Executable file
View File

@ -0,0 +1,89 @@
-- Dog
mobs:register_mob("mobs:dog", {
-- animal, monster, npc, barbarian
type = "npc",
-- agressive, does 4 damage to player when hit
passive = false,
attacks_monsters = true,
attack_type = "dogfight",
damage = 2, -- 1 damage less than wolf
-- health & armor
hp_min = 15, hp_max = 20, armor = 200,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
visual = "mesh",
mesh = "mobs_wolf.x",
drawtype = "front",
textures = {
{"mobs_dog.png"},
},
--visual_size = {x=1,y=1}, --Quel valeur lui mettre ?
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_wolf",
war_cry = "mobs_wolf_attack",
},
-- speed and jump
walk_velocity = 2,
run_velocity = 4,
jump = true,
stepheight = 1.2,
step = 1.2,
view_range = 16,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 2, max = 3,},
},
-- damaged by
water_damage = 0,
lava_damage = 5,
light_damage = 0,
-- Special for pet
owner = "",
order = "follow",
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
if not name then return end
if item:get_name() == "mobs:meat_raw" then
local hp = self.object:get_hp()
-- return if full health
if hp >= self.hp_max then
minetest.chat_send_player(name, "Dog at full health.")
return
end
hp = hp + 4 -- add restorative value
-- new health shouldn't exceed self.hp_max
if hp > self.hp_max then hp = self.hp_max end
self.object:set_hp(hp)
-- Take item
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
else
if self.owner == "" then
self.owner = clicker:get_player_name()
else
if self.order == "follow" then
self.order = "stand"
else
self.order = "follow"
end
end
end
end,
-- model animation
animation = {
stand_start = 0, stand_end = 14,
walk_start = 15, walk_end = 38,
run_start = 40, run_end = 63,
punch_start = 40, punch_end = 63,
speed_normal = 15, speed_run = 15,
},
})
mobs:register_egg("mobs:dog", "Dog", "mobs_dog_inv.png", 1)

113
dungeonmaster.lua Executable file
View File

@ -0,0 +1,113 @@
-- Dungeon Master by PilzAdam
mobs:register_mob("mobs:dungeon_master", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, shoots fireballs at player, deal 9 damages
passive = false,
pathfinding = false,
damage = 9,
attack_type = "dogshoot",
reach = 3,
shoot_interval = 2.5,
arrow = "mobs:fireball",
shoot_offset = 1,
-- health & armor
hp_min = 30,
hp_max = 40,
armor = 80,
-- textures and model
collisionbox = {-0.7, -1, -0.7, 0.7, 1.6, 0.7},
visual = "mesh",
mesh = "mobs_dungeon_master.b3d",
textures = {
{"mobs_dungeon_master.png"},
{"mobs_dungeon_master_cobblestone.png"},
{"mobs_dungeon_master_strangewhite.png"},
},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_dungeonmaster",
shoot_attack = "mobs_fireball",
},
-- speed and jump
walk_velocity = 1,
run_velocity = 2,
jump = false,
view_range = 16,
knock_back = 0.05, -- Very small knockback
-- drops mese or diamond when dead
drops = {
{name = "mobs:dungeon_master_blood", chance = 2, min = 1, max = 2,},
{name = "default:diamond", chance = 4, min = 1, max = 3,},
{name = "default:mese_crystal", chance = 4, min = 3, max = 6,},
{name = "mobs:dungeon_master_diamond", chance = 6, min = 1, max = 1,},
{name = "maptools:gold_coin", chance = 20, min = 1, max = 1,},
{name = "default:diamondblock", chance = 33, min = 1, max = 1,},
{name = "runes:scroll_watchdog", chance = 130, min = 1, max = 5},
},
-- damaged by
water_damage = 1,
lava_damage = 1,
light_damage = 0,
fear_height = 3,
-- model animation
animation = {
stand_start = 0,
stand_end = 19,
walk_start = 20,
walk_end = 35,
punch_start = 36,
punch_end = 48,
speed_normal = 15,
speed_run = 15,
},
})
-- spawn on stone between 20 and -1 light, 1 in 10000 chance, 1 dungeon master in area starting at -100 and below
mobs:spawn_specific("mobs:dungeon_master", {"default:stone", "default:sandstone", "nether:netherrack"}, {"air"}, -1, 20, 30, 10000, 1, -31000, -250, false)
-- register spawn egg
mobs:register_egg("mobs:dungeon_master", "Dungeon Master", "mobs_dongeon_master_inv.png", 1)
-- fireball (weapon)
mobs:register_arrow("mobs:fireball", {
visual = "sprite",
visual_size = {x = 1, y = 1},
textures = {"mobs_fireball.png"},
velocity = 6,
-- direct hit, no fire... just plenty of pain
hit_player = function(self, player)
player:punch(self.object, 1.0, { -- Mettre à 2.5 aussi ?
full_punch_interval = 2.5, -- Modif MFF
damage_groups = {fleshy = 9}, -- Modif MFF
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, { -- Mettre à 2.5 aussi ?
full_punch_interval = 2.5, -- Modif MFF
damage_groups = {fleshy = 9}, -- Modif MFF
}, nil)
end,
-- node hit, bursts into flame (cannot blast through obsidian or protection redo mod items)
hit_node = function(self, pos, node)
mobs:explosion(pos, 1, 1, 0)
end
})
minetest.register_craftitem("mobs:dungeon_master_blood", {
description = "Dungeon Master Blood",
inventory_image = "mobs_dungeon_master_blood.png",
groups = {magic = 1},
})
minetest.register_craftitem("mobs:dungeon_master_diamond", {
description = "Dungeon Master Diamond",
inventory_image = "mobs_dungeon_master_diamond.png",
groups = {magic = 1},
})

106
goat.lua Executable file
View File

@ -0,0 +1,106 @@
-- Goat by DonBatman
mobs:register_mob("mobs:goat", {
-- animal, monster, npc, barbarian
type = "animal",
-- aggressive, does 5 damage to player when threatened
passive = false,
group_attack = true,
attack_type = "dogfight",
reach = 2,
damage = 3,
-- health & armor
hp_min = 10,
hp_max = 20,
armor = 200,
-- textures and model
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.75, 0.3},
visual = "mesh",
mesh = "mobs_goat.b3d",
drawtype = "front",
textures = {
{"mobs_goat_white.png"},
{"mobs_goat_brown.png"},
{"mobs_goat_grey.png"},
},
blood_texture = "mobs_blood.png",
visual_size = {x=2,y=2},
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_sheep",
},
-- speed and jump
walk_velocity = 1.5,
run_velocity = 3,
jump = true,
-- drops raw meat when dead
drops = {
{name = "mobs:meat_raw",
chance = 1, min = 2, max = 4},
{name = "maptools:silver_coin",
chance = 10, min = 1, max = 1,},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 0,
-- model animation
animation = {
speed_normal = 25, speed_run = 30,
stand_start = 0, stand_end = 60, -- head down/up
walk_start = 80, walk_end = 110, -- walk
run_start = 160, run_end = 198, -- walk
punch_start = 120, punch_end = 150, -- attack
},
-- follows wheat
follow = "farming:wheat",
view_range = 10,
-- replace grass/wheat with air (eat)
replace_rate = 50,
replace_what = {"group:flora"},
replace_with = "air",
on_rightclick = function(self, clicker)
-- feed or tame
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
local tool = clicker:get_wielded_item()
-- milk goat with empty bucket
if tool:get_name() == "bucket:bucket_empty" then
if self.child == true then
return
end
if self.gotten == true then
minetest.chat_send_player(clicker:get_player_name(),
"Goat already milked!")
return
end
local inv = clicker:get_inventory()
inv:remove_item("main", "bucket:bucket_empty")
if inv:room_for_item("main", {name = "mobs:bucket_milk"}) then
clicker:get_inventory():add_item("main", "mobs:bucket_milk")
else
local pos = self.object:getpos()
pos.y = pos.y + 0.5
minetest.add_item(pos, {name = "mobs:bucket_milk"})
end
self.gotten = true -- milked
return
end
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end,
})
-- spawn on dirt_with_grass between -1 and 20 light, 1 in 20000 chance, 1 goat in area up to 31000 in height
mobs:spawn_specific("mobs:goat", {"default:dirt_with_grass"}, {"air"}, -1, 20, 30, 20000, 1, -31000, 31000, true)
-- register spawn egg
mobs:register_egg("mobs:goat", "Goat", "mobs_goat_inv.png", 1)

169
greenslimes.lua Executable file
View File

@ -0,0 +1,169 @@
-- Green Slimes by TomasJLuis & TenPlus1
-- sounds
local green_sounds = {
damage = "mobs_slimes_damage",
death = "mobs_slimes_death",
jump = "mobs_slimes_jump",
attack = "mobs_slimes_attack",
}
-- green slime textures
local green_textures = {"mobs_green_slime_sides.png", "mobs_green_slime_sides.png", "mobs_green_slime_sides.png", "mobs_green_slime_sides.png", "mobs_green_slime_front.png", "mobs_green_slime_sides.png"}
-- register small green slime
mobs:register_mob("mobs:greensmall", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 2 damage to player when hit
passive = false,
pathfinding = false,
reach = 2,
damage = 2,
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 4, hp_max = 8,
armor = 200,
-- textures and model
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual = "cube",
textures = { green_textures },
blood_texture = "mobs_green_slime_blood.png",
visual_size = {x = 0.5, y = 0.5},
-- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false,
sounds = green_sounds,
-- speed and jump, sinks in water
walk_velocity = 4,
run_velocity = 4,
walk_chance = 0,
jump = true,
jump_chance = 30,
jump_height = 6,
view_range = 16,
floats = 1,
-- chance of dropping glue and coins
drops = {
{name = "mesecons_materials:glue", chance = 4, min = 1, max = 2},
{name = "maptools:silver_coin", chance = 4, min = 1, max = 1,},
},
-- damaged by
water_damage = 0,
lava_damage = 10,
light_damage = 0,
-- model animation
-- no model animation
})
mobs:register_egg("mobs:greensmall", "Small Green Slime", "mobs_green_slime_medium_inv.png", 1)
-- register medium green slime
mobs:register_mob("mobs:greenmedium", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 4 damage to player when hit
passive = false,
reach = 2,
damage = 3,
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 15, hp_max = 25,
armor = 100,
-- textures and model
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
textures = { green_textures },
blood_texture = "mobs_green_slime_blood.png",
visual_size = {x = 1, y = 1},
-- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false,
sounds = green_sounds,
-- speed and jump, sinks in water
walk_velocity = 3,
run_velocity = 3,
walk_chance = 0,
jump = true,
jump_chance = 30,
jump_height = 6,
view_range = 16,
floats = 1,
-- chance of dropping glue and coins
drops = {
},
-- damaged by
water_damage = 0,
lava_damage = 10,
light_damage = 0,
-- model animation
-- no model animation
-- do things when die
on_die = function(self, pos)
local num = math.random(2, 4)
for i=1,num do
minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, "mobs:greensmall")
end
end,
})
mobs:register_egg("mobs:greenmedium", "Medium Green Slime", "mobs_green_slime_medium_inv.png", 1)
-- register big green slime
mobs:register_mob("mobs:greenbig", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 6 damage to player when hit
passive = false,
reach = 2,
damage = 5,
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 30, hp_max = 50,
armor = 100,
-- textures and model
collisionbox = {-1, -1, -1, 1, 1, 1},
visual = "cube",
textures = { green_textures },
blood_texture = "mobs_green_slime_blood.png",
visual_size = {x = 2, y = 2},
-- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false,
sounds = green_sounds,
-- speed and jump, sinks in water
walk_velocity = 2.5,
run_velocity = 2.5,
walk_chance = 0,
jump = true,
jump_chance = 30,
jump_height = 6,
view_range = 16,
floats = 1,
knock_back = 0, --this is a test
-- chance of dropping glue and coins
drops = {
},
-- damaged by
water_damage = 0,
lava_damage = 10,
light_damage = 0,
-- model animation
-- no model animation
-- do things when die
on_die = function(self, pos)
local num = math.random(1, 2)
for i=1,num do
minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, "mobs:greenmedium")
end
end,
})
mobs:register_egg("mobs:greenbig", "Big Green Slime", "mobs_green_slime_big_inv.png", 1)
--mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height)
mobs:spawn_specific("mobs:greenbig", {"default:acid_source"},{"default:acid_flowing"}, -1, 20, 30, 5000, 1, -32000, 32000, false)
mobs:spawn_specific("mobs:greenmedium", {"default:acid_source"},{"default:acid_flowing"},-1, 20, 30, 5000, 2, -32000, 32000, false)
--mobs:spawn_specific("mobs:greensmall", {"default:acid_source"},{"default:acid_flowing"},-1, 20, 30, 10000, 2, -32000, 32000)
--mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height)
--mobs:register_spawn("mobs:greenmedium", {"default:mossycobble"}, 20, 4, 10000, 8, 32000)
--mobs:register_spawn("mobs:greensmall", {"default:mossycobble"}, 20, 4, 10000, 8, 32000)

75
init.lua Normal file → Executable file
View File

@ -1,13 +1,84 @@
local path = minetest.get_modpath("mobs")
-- Mob Api
dofile(path.."/api.lua")
-- Animals
dofile(path.."/chicken.lua") -- JKmurray
dofile(path.."/cow.lua") -- KrupnoPavel
dofile(path.."/sheep.lua") -- PilzAdam
dofile(path.."/pig.lua") -- farfadet46
dofile(path.."/bee.lua") -- KrupnoPavel
dofile(path.."/bunny.lua") -- ExeterDad
dofile(path.."/kitten.lua") -- Jordach/BFD
dofile(path.."/goat.lua") -- ???
dofile(path.."/shark.lua") -- blert2112 (animal_modpack)
-- Monsters
dofile(path.."/dirtmonster.lua") -- PilzAdam
dofile(path.."/dungeonmaster.lua") -- PilzAdam
dofile(path.."/oerkki.lua") -- PilzAdam
dofile(path.."/sandmonster.lua") -- PilzAdam
dofile(path.."/stonemonster.lua") -- PilzAdam
dofile(path.."/treemonster.lua") -- PilzAdam
dofile(path.."/wolf.lua") -- PilzAdam
dofile(path.."/dog.lua") -- CProgrammerRU
dofile(path.."/mese_monster.lua") -- Zeg9
dofile(path.."/spider.lua") -- AspireMint
dofile(path.."/greenslimes.lua") -- davedevils/TomasJLuis/TenPlus1
dofile(path.."/lavaslimes.lua") -- davedevils/TomasJLuis/TenPlus1
dofile(path.."/zombie.lua") -- ???
dofile(path.."/yeti.lua") -- ???
dofile(path.."/minotaur.lua") -- Kalabasa
-- The bosses
dofile(path.."/pumpkins.lua") -- ???
dofile(path.."/mese_dragon.lua") -- farfadet46
-- begin slimes mobs compatibility changes
-- cannot find mesecons?, craft glue instead
if not minetest.get_modpath("mesecons_materials") then
minetest.register_craftitem(":mesecons_materials:glue", {
image = "mesecons_glue.png",
description = "Glue",
})
end
if minetest.setting_get("log_mods") then minetest.log("action", "Slimes loaded") end
-- end slimes mobs compatibility changes
-- NPC
dofile(path.."/npc.lua") -- TenPlus1
dofile(path.."/npc_female.lua") -- nuttmeg20
-- Creeper (fast impl by davedevils)
dofile(path.."/creeper.lua")
-- Mob Items
dofile(path.."/crafts.lua")
-- Spawner
dofile(path.."/spawner.lua")
print ("[MOD] Mobs Redo loaded")
-- Mob menu spawner special MFF
dofile(path.."/mff_menu.lua")
minetest.register_alias("mobs:rat","mobs:chicken") -- aliases removed rat
minetest.register_alias("mobs:rat_cooked", "mobs:chicken_cooked")
local function remove_old(name)
minetest.register_entity(name, {
name = name,
on_activate = function(self, staticdata, dtime_s)
self.object:remove()
return
end,
})
end
remove_old("mobs:pumba")
remove_old("mobs:rat")
minetest.log("action", "[MOD] Mobs Redo loaded")

73
kitten.lua Executable file
View File

@ -0,0 +1,73 @@
-- Kitten by Jordach / BFD
mobs:register_mob("mobs:kitten", {
-- animal, monster, npc
type = "animal",
-- is it aggressive
passive = true,
-- health & armor
hp_min = 5,
hp_max = 10,
armor = 200,
-- textures and model
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.1, 0.3},
visual = "mesh",
visual_size = {x = 0.5, y = 0.5},
mesh = "mobs_kitten.b3d",
textures = {
{"mobs_kitten_striped.png"},
{"mobs_kitten_splotchy.png"},
{"mobs_kitten_ginger.png"},
{"mobs_kitten_sandy.png"},
},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = false,
sounds = {
random = "mobs_kitten",
},
-- speed and jump
walk_velocity = 0.6,
run_velocity = 2,
runaway = true,
jump = false,
-- drops string
drops = {
{name = "farming:string", chance = 2, min = 1, max = 1},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
fear_height = 3,
-- model animation
animation = {
speed_normal = 42,
stand_start = 97,
stand_end = 192,
walk_start = 0,
walk_end = 96,
},
-- follows Rat and Raw Fish
follow = {
"fishing:fish_raw",
"fishing:clownfish_raw",
"fishing:bluewhite_raw",
"fishing:exoticfish_raw",
"fishing:carp_raw",
"fishing:perch_raw",
"fishing:catfish_raw",
},
view_range = 10,
-- feed with raw fish to tame or right click to pick up
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 4, true, true) then
return
end
mobs:capture_mob(self, clicker, 50, 50, 90, false, nil)
end
})
mobs:spawn_specific("mobs:kitten", {"default:dirt_with_grass"}, {"air"}, 0, 20, 30, 15000, 1, -31000, 31000, true, true)
mobs:register_egg("mobs:kitten", "Kitten", "mobs_kitten_inv.png", 0)

184
lavaslimes.lua Executable file
View File

@ -0,0 +1,184 @@
-- Lava Slimes by TomasJLuis & TenPlus1
-- sounds
local lava_sounds = {
damage = "mobs_slimes_damage",
death = "mobs_slimes_death",
jump = "mobs_slimes_jump",
attack = "mobs_slimes_attack",
}
-- lava slime textures
local lava_textures = {"mobs_lava_slime_sides.png", "mobs_lava_slime_sides.png", "mobs_lava_slime_sides.png", "mobs_lava_slime_sides.png", "mobs_lava_slime_front.png", "mobs_lava_slime_sides.png"}
-- register small lava slime
mobs:register_mob("mobs:lavasmall", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 2 damage to player when hit
passive = false,
pathfinding = false,
reach = 2,
damage = 2,
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 4,
hp_max = 8,
armor = 200,
-- textures and model
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual = "cube",
textures = { lava_textures },
blood_texture = "mobs_lava_slime_blood.png",
visual_size = {x = 0.5, y = 0.5},
-- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false,
sounds = lava_sounds,
-- speed and jump, sinks in water
walk_velocity = 4,
run_velocity = 4,
walk_chance = 0,
jump = true,
jump_chance = 30,
jump_height = 6,
replace_rate = 20,
footstep = "fire:basic_flame",
view_range = 16,
floats = 1,
-- chance of dropping lava orb and coins
drops = {
{name = "mobs:lava_orb", chance = 15, min = 1, max = 1,},
{name = "maptools:silver_coin", chance = 4, min = 1, max = 1,},
},
-- damaged by
water_damage = 10,
lava_damage = 0,
light_damage = 0,
-- model animation
-- no model animation
})
mobs:register_egg("mobs:lavasmall", "Small Lava Slime", "mobs_lava_slime_medium_inv.png", 1)
-- register medium lava slime
mobs:register_mob("mobs:lavamedium", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 4 damage to player when hit
passive = false,
reach = 2,
damage = 3,
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 15,
hp_max = 25,
armor = 100,
-- textures and model
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
textures = { lava_textures },
blood_texture = "mobs_lava_slime_blood.png",
visual_size = {x = 1, y = 1},
-- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false,
sounds = lava_sounds,
-- speed and jump, sinks in water
walk_velocity = 3,
run_velocity = 3,
walk_chance = 0,
jump = true,
jump_chance = 30,
jump_height = 6,
replace_rate = 20,
footstep = "fire:basic_flame",
view_range = 16,
floats = 1,
-- chance of dropping lava orb and coins
drops = {
},
-- damaged by
water_damage = 10,
lava_damage = 0,
light_damage = 0,
-- model animation
-- no model animation
-- do things when die
on_die = function(self, pos)
local num = math.random(2, 4)
for i=1,num do
minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, "mobs:lavasmall")
end
end,
})
mobs:register_egg("mobs:lavamedium", "Medium Lava Slime", "mobs_lava_slime_medium_inv.png", 1)
-- register big lava slime
mobs:register_mob("mobs:lavabig", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 6 damage to player when hit
passive = false,
reach = 2,
damage = 5,
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 30, hp_max = 50,
armor = 100,
-- textures and model
collisionbox = {-1, -1, -1, 1, 1, 1},
visual = "cube",
textures = { lava_textures },
blood_texture = "mobs_lava_slime_blood.png",
visual_size = {x = 2, y = 2},
-- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false,
sounds = lava_sounds,
-- speed and jump, sinks in water
walk_velocity = 2.5,
run_velocity = 2.5,
walk_chance = 0,
jump = true,
jump_chance = 30,
jump_height = 6,
replace_rate = 20,
replace_offset = -1,
footstep = "fire:basic_flame",
view_range = 16,
floats = 1,
knock_back = 0, --this is a test
-- chance of dropping lava orb and coins
drops = {
},
-- damaged by
water_damage = 10,
lava_damage = 0,
light_damage = 0,
-- model animation
-- no model animation
-- do things when die
on_die = function(self, pos)
local num = math.random(1, 2)
for i=1,num do
minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, "mobs:lavamedium")
end
end,
})
mobs:register_egg("mobs:lavabig", "Big Lava Slime", "mobs_lava_slime_big_inv.png", 1)
--mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height)
mobs:spawn_specific("mobs:lavabig", {"default:lava_source"},{"default:lava_flowing"}, -1, 20, 30, 5000, 1, -32000, 32000, false)
mobs:spawn_specific("mobs:lavamedium", {"default:lava_source"},{"default:lava_flowing"}, -1, 20, 30, 5000, 2, -32000, 32000, false)
--mobs:spawn_specific("mobs:lavasmall", {"default:lava_source"},{"default:lava_flowing"}, -1, 20, 30, 10s000, 2, -32000, 32000, false)
-- lava orb
minetest.register_craftitem("mobs:lava_orb", {
description = "Lava orb",
inventory_image = "zmobs_lava_orb.png",
})
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")

0
license.txt Normal file → Executable file
View File

124
mese_dragon.lua Normal file
View File

@ -0,0 +1,124 @@
mobs:register_mob("mobs:mese_dragon", {
type = "monster",
-- agressive, deals 13 damage to player when hit
passive = false,
damage = 13,
attack_type = "dogshoot",
reach = 4,
shoot_interval = 2,
arrow = "mobs:mese_dragon_fireball",
shoot_offset = -0.5,
-- health & armor
hp_min = 175,
hp_max = 225,
armor = 70,
-- textures and model
collisionbox = {-0.6, 0, -0.6, 0.6, 5, 0.6},
visual = "mesh",
mesh = "mese_dragon.b3d",
textures = {
{"mese_dragon.png"},
},
visual_size = {x=3, y=3},
blood_texture = "default_mese_crystal_fragment.png",
-- sounds
makes_footstep_sound = true,
sounds = {
shoot_attack = "mesed",
attack = "mese_dragon",
distance = 60,
},
-- speed and jump
view_range = 20,
knock_back = 0,
walk_velocity = 1.5,
run_velocity = 3.5,
pathfinding = false,
jump = true,
jump_height = 4,
fall_damage = 0,
fall_speed = -6,
stepheight = 1.5,
-- drops returnmirror & mese & class items when dead
drops = {
-- Ressource & Decoration drops
{name = "default:mese", chance = 2, min = 2, max = 4},
{name = "returnmirror:mirror_inactive", chance = 10, min = 1, max = 1},
-- Tools drops
{name = "default:pick_mese", chance = 33, min = 1, max = 1},
{name = "default:shovel_mese", chance = 33, min = 1, max = 1},
{name = "default:axe_mese", chance = 33, min = 1, max = 1},
{name = "farming:hoe_mese", chance = 33, min = 1, max = 1},
-- Hunter drops
{name = "3d_armor:leggings_hardenedleather", chance = 10, min = 1, max = 1},
{name = "3d_armor:boots_hardenedleather", chance = 10, min = 1, max = 1},
{name = "throwing:arbalest", chance = 33, min = 1, max = 1},
-- Warrior drops
{name = "3d_armor:leggings_mithril", chance = 10, min = 1, max = 1},
{name = "3d_armor:boots_mithril", chance = 10, min = 1, max = 1},
{name = "default:sword_mese", chance = 33, min = 1, max = 1},
},
-- damaged by
water_damage = 0,
lava_damage = 0,
light_damage = 0,
-- model animation
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 80,
walk_start = 180,
walk_end = 200,
run_start = 180,
run_end = 200,
punch_start = 140,
punch_end = 170,
},
on_die = function(self)
minetest.chat_send_all("A group of players killed a Mese Dragon!")
end
})
-- mese_dragon_fireball (weapon)
mobs:register_arrow("mobs:mese_dragon_fireball", {
visual = "sprite",
visual_size = {x = 1, y = 1},
textures = {"mobs_mese_dragon_fireball.png"},
velocity = 10,
-- direct hit, no fire... just plenty of pain
hit_player = function(self, player)
player:punch(self.object, 2.0, { -- Modif MFF
full_punch_interval = 2.0, -- Modif MFF
damage_groups = {fleshy = 13}, -- Modif MFF
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 2.0, { -- Modif MFF
full_punch_interval = 2.0, -- Modif MFF
damage_groups = {fleshy = 13}, -- Modif MFF
}, nil)
end,
-- node hit, bursts into flame
hit_node = function(self, pos, node)
mobs:explosion(pos, 1, 1, 0)
end
})
minetest.register_node("mobs:mese_dragon_spawner", {
description = "Mese Dragon Spawner",
tiles = {"default_mese_block.png"},
is_ground_content = false,
groups = {unbreakable = 1, mob_spawner=1},
sounds = default.node_sound_stone_defaults({
dug = {name="mobs_boom", gain=0.25}
})
})
--(name, nodes, neighbors, interval, chance, active_object_count)
-- spawn on mobs:mese_dragon_spawner, interval 300, 1 chance, 1 mese_dragon_spawner
mobs:spawn_special("mobs:mese_dragon", {"mobs:mese_dragon_spawner"}, {"air"}, 300, 1, 1)
mobs:register_egg("mobs:mese_dragon", "Mese Dragon", "mobs_mese_dragon_inv.png", 1)

117
mese_monster.lua Executable file
View File

@ -0,0 +1,117 @@
-- Mese Monster by Zeg9
mobs:register_mob("mobs:mese_monster", {
-- animal, monster, npc, barbarian
type = "monster",
-- agressive, deals 4 damage to player when hit
passive = false,
damage = 4,
attack_type = "shoot",
shoot_interval = 1.0,
arrow = "mobs:mese_arrow",
shoot_offset = 2,
-- health & armor
hp_min = 20,
hp_max = 25,
armor = 80,
-- textures and model
collisionbox = {-0.5, -1.5, -0.5, 0.5, 0.5, 0.5},
visual = "mesh",
mesh = "zmobs_mese_monster.x",
textures = {
{"zmobs_mese_monster.png"},
},
visual_size = {x=1, y=1},
blood_texture = "default_mese_crystal_fragment.png",
-- sounds
makes_footstep_sound = false,
sounds = {
random = "mobs_mesemonster",
},
-- speed and jump
view_range = 16,
walk_velocity = 1,
run_velocity = 2,
jump = true,
jump_height = 8,
fall_damage = 0,
fall_speed = -6,
stepheight = 2.1,
-- drops mese when dead
drops = {
{name = "default:mese_crystal", chance = 9, min = 1, max = 3,},
{name = "default:mese_crystal_fragment", chance = 1, min = 1, max = 9,},
{name = "maptools:silver_coin", chance = 1, min = 1, max = 2,},
{name = "returnmirror:mirror_inactive", chance = 50, min = 1, max = 1,},
},
-- damaged by
water_damage = 0,
lava_damage = 0,
light_damage = 0,
-- model animation
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 14,
walk_start = 15,
walk_end = 38,
run_start = 40,
run_end = 63,
punch_start = 40,
punch_end = 63,
},
})
minetest.register_node("mobs:mese_monster_spawner", {
description = "Mese Monster Spawner",
tiles = {"default_mese_block.png"},
is_ground_content = false,
groups = {unbreakable = 1, mob_spawner=1},
sounds = default.node_sound_stone_defaults({
dug = {name="mobs_boom", gain=0.25} -- to be changed
})
})
-- spawn on stone between 20 and -1 light, 1 in 8000 chance, 1 in area below -25
mobs:spawn_specific("mobs:mese_monster", {"default:stone", "default:sandstone"}, {"air"}, -1, 20, 30, 8000, 1, -31000, -125, false)
-- Spawn in spawner
mobs:spawn_specific("mobs:mese_monster", {"mobs:mese_monster_spawner"}, {"air"}, 1, 20, 300, 1, 100, -31000, 31000, true)
-- register spawn egg
mobs:register_egg("mobs:mese_monster", "Mese Monster", "mobs_mese_monster_inv.png", 1)
-- mese arrow (weapon)
mobs:register_arrow("mobs:mese_arrow", {
visual = "sprite",
visual_size = {x = 0.5, y = 0.5},
textures = {"default_mese_crystal_fragment.png"},
velocity = 6,
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8}, --Modif MFF
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8}, --Modif MFF
}, nil)
end,
hit_node = function(self, pos, node)
end
})
-- 9x mese crystal fragments = 1x mese crystal
minetest.register_craft({
output = "default:mese_crystal",
recipe = {
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
}
})

59
mff_menu.lua Executable file
View File

@ -0,0 +1,59 @@
--Menu mobs spawner
mobs.shown_spawner_menu = function(player_name)
local formspec = {"size[8,9]label[2.7,0;Mobs Spawner]"}
if mobs["spawning_mobs"] ~= nil then
local Y = 1
local X = 1
for name, etat in pairs(mobs["spawning_mobs"]) do
table.insert(formspec, "item_image_button["..X..","..Y..";1,1;"..name..";"..name..";]")
X = X+1
if X > 6 then
X = 1
Y = Y+1.2
end
end
end
table.insert(formspec, "button_exit[3.9,8.5;1.2,1;close;Close]")
minetest.show_formspec(player_name, "mobs:spawner", table.concat(formspec))
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
local player_name = player:get_player_name()
if not player_name then return end
if formname == "mobs:spawner" then
for f in pairs(fields) do
if string.find(f, "mobs:") then
local pos = player:getpos()
pos.y = pos.y+1
minetest.add_entity(pos, f)
return
end
end
end
end)
if (minetest.get_modpath("unified_inventory")) ~= nil then
unified_inventory.register_button("menu_mobs", {
type = "image",
image = "mobs_dungeon_master_fireball.png",
tooltip = "Mobs Spawner Menu",
show_with = "server",
action = function(player)
local player_name = player:get_player_name()
if not player_name then return end
if minetest.check_player_privs(player_name, {server=true}) then
mobs.shown_spawner_menu(player_name)
end
end,
})
else
minetest.register_chatcommand("mobs_spawner", {
params = "",
description = "Spawn entity at given (or your) position",
privs = {server=true},
func = function(name, param)
mobs.shown_spawner_menu(name)
end,
})
end

94
minotaur.lua Executable file
View File

@ -0,0 +1,94 @@
-- Minotaur Monster by ???
mobs:register_mob("mobs:minotaur", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 11 damage to player when hit
passive = false,
attack_type = "dogfight",
pathfinding = false,
reach = 2,
damage = 6,
-- health & armor
hp_min = 45,
hp_max = 55,
armor = 90,
-- textures and model
collisionbox = {-0.9,-0.01,-0.9, 0.9,2.5,0.9},
visual = "mesh",
mesh = "mobs_minotaur.b3d",
textures = {
{"mobs_minotaur.png"},
},
visual_size = {x=1, y=1},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
-- sounds = {
-- random = "mobs_zombie",
-- damage = "mobs_zombie_hit",
-- attack = "mobs_zombie_attack",
-- death = "mobs_zombie_death",
-- },
-- speed and jump
walk_velocity = 1,
run_velocity = 3,
jump = true,
floats = 1,
view_range = 16,
knock_back = 0.05, --this is a test
-- drops desert_sand and coins when dead
drops = {
{name = "maptools:gold_coin", chance = 40, min = 1, max = 1,},
{name = "mobs:minotaur_eye", chance = 2, min = 1, max = 2,},
{name = "mobs:minotaur_horn", chance = 4, min = 1, max = 2,},
{name = "mobs:minotaur_fur", chance = 1, min = 1, max = 3,},
},
water_damage = 0,
lava_damage = 5,
light_damage = 0,
-- model animation
animation = {
speed_normal = 15, speed_run = 15,
stand_start = 0, stand_end = 19,
walk_start = 20, walk_end = 39,
run_start = 20, run_end = 39,
punch_start = 40, punch_end = 50,
},
})
-- spawns on desert sand between -1 and 20 light, 1 in 100000 chance, 1 Minotaur in area up to 31000 in height
mobs:spawn_specific("mobs:minotaur", {"default:dirt_with_dry_grass"}, {"air"}, -1, 20, 30, 100000, 1, -31000, 31000, false)
-- register spawn egg
mobs:register_egg("mobs:minotaur", "Minotaur", "mobs_minotaur_inv.png", 1)
minetest.register_craftitem("mobs:minotaur_eye", {
description = "Minotaur Eye",
inventory_image = "mobs_minotaur_eye.png",
groups = {magic = 1},
})
minetest.register_craftitem("mobs:minotaur_horn", {
description = "Minotaur Horn",
inventory_image = "mobs_minotaur_horn.png",
groups = {magic = 1},
})
minetest.register_craftitem("mobs:minotaur_fur", {
description = "Minotaur Fur",
inventory_image = "mobs_minotaur_fur.png",
groups = {magic = 1},
})
minetest.register_craftitem("mobs:minotaur_lots_of_fur", {
description = "Lot of Minotaur Fur",
inventory_image = "mobs_minotaur_lots_of_fur.png",
groups = {magic = 1},
})
minetest.register_craft({
output = "mobs:minotaur_lots_of_fur",
recipe = {{"mobs:minotaur_fur", "mobs:minotaur_fur"},
{"mobs:minotaur_fur", "mobs:minotaur_fur"},
},
})

View File

@ -1 +0,0 @@
name = mobs

BIN
models/character.b3d Executable file

Binary file not shown.

BIN
models/mese_dragon.b3d Normal file

Binary file not shown.

7645
models/mobs_bee.x Executable file

File diff suppressed because it is too large Load Diff

BIN
models/mobs_bunny.b3d Executable file

Binary file not shown.

3080
models/mobs_chicken.x Executable file

File diff suppressed because it is too large Load Diff

BIN
models/mobs_cow.b3d Normal file

Binary file not shown.

BIN
models/mobs_dungeon_master.b3d Executable file

Binary file not shown.

BIN
models/mobs_goat.b3d Normal file

Binary file not shown.

BIN
models/mobs_kitten.b3d Executable file

Binary file not shown.

BIN
models/mobs_minotaur.b3d Executable file

Binary file not shown.

BIN
models/mobs_oerkki.b3d Executable file

Binary file not shown.

BIN
models/mobs_pig.b3d Executable file

Binary file not shown.

14742
models/mobs_pumpboom.x Executable file

File diff suppressed because it is too large Load Diff

55341
models/mobs_pumpking.x Executable file

File diff suppressed because it is too large Load Diff

BIN
models/mobs_sand_monster.b3d Executable file

Binary file not shown.

BIN
models/mobs_shark.b3d Executable file

Binary file not shown.

BIN
models/mobs_sheep.b3d Executable file

Binary file not shown.

BIN
models/mobs_sheep_shaved.b3d Executable file

Binary file not shown.

6103
models/mobs_spider.x Executable file

File diff suppressed because it is too large Load Diff

BIN
models/mobs_stone_monster.b3d Executable file

Binary file not shown.

BIN
models/mobs_tree_monster.b3d Executable file

Binary file not shown.

7420
models/mobs_wolf.x Executable file

File diff suppressed because it is too large Load Diff

5524
models/mobs_zombie.x Executable file

File diff suppressed because it is too large Load Diff

2999
models/zmobs_mese_monster.x Executable file

File diff suppressed because it is too large Load Diff

131
npc.lua Executable file
View File

@ -0,0 +1,131 @@
-- Npc by TenPlus1
mobs.npc_drops = { "farming:meat", "farming:donut", "farming:bread", "default:apple", "default:sapling", "default:junglesapling",
"shields:shield_enhanced_wood", "3d_armor:chestplate_cactus", "3d_armor:boots_bronze",
"default:sword_steel", "default:pick_steel", "default:shovel_steel", "default:bronze_ingot",
"bucket:bucket_water", "default:stick", "cavestuff:pebble_1", "building_blocks:stick",
"default:cobble", "default:gravel", "default:clay_lump", "default:sand", "default:dirt_with_grass",
"default:dirt", "default:chest", "default:torch"}
mobs:register_mob("mobs:npc", {
-- animal, monster, npc
type = "npc",
-- aggressive, deals 6 damage to player/monster when hit
passive = false,
group_attack = true,
damage = 4, -- 3 damages if tamed
attack_type = "dogfight",
attacks_monsters = true,
pathfinding = false,
-- health & armor
hp_min = 20,
hp_max = 20,
armor = 200,
-- textures and model
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
visual = "mesh",
mesh = "character.b3d",
drawtype = "front",
textures = {
{"mobs_npc.png"},
},
child_texture = {
{"mobs_npc_baby.png"}, -- derpy baby by AmirDerAssassine
},
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_npc",
damage = "mobs_npc_hit",
attack = "mobs_npc_attack",
death = "mobs_npc_death",
},
-- speed and jump
walk_velocity = 3,
run_velocity = 3,
jump = true,
-- drops wood and chance of apples when dead
drops = {
{name = "default:wood", chance = 1, min = 1, max = 3},
{name = "default:apple", chance = 2, min = 1, max = 2},
{name = "default:axe_stone", chance = 3, min = 1, max = 1},
{name = "maptools:silver_coin", chance = 10, min = 1, max = 1,},
},
-- damaged by
water_damage = 0,
lava_damage = 6,
light_damage = 0,
-- follow diamond
follow = {"farming:bread", "mobs:meat", "default:diamond"},
view_range = 16,
-- set owner and order
owner = "",
order = "follow",
fear_height = 3,
-- model animation
animation = {
speed_normal = 30,
speed_run = 30,
stand_start = 0,
stand_end = 79,
walk_start = 168,
walk_end = 187,
run_start = 168,
run_end = 187,
punch_start = 200,
punch_end = 219,
},
-- right clicking with "cooked meat" or "bread" will give npc more health
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
if item:get_name() == "default:diamond" then --/MFF (Crabman|07/14/2015) tamed with diamond
if (self.diamond_count or 0) < 4 then
self.diamond_count = (self.diamond_count or 0) + 1
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
if self.diamond_count >= 4 then
self.damages = 3
self.tamed = true
self.owner = clicker:get_player_name()
end
end
return
-- feed to heal npc
elseif not mobs:feed_tame(self, clicker, 8, true, true) then
-- right clicking with gold lump drops random item from mobs.npc_drops
if item:get_name() == "default:gold_lump" then
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
local pos = self.object:getpos()
pos.y = pos.y + 0.5
minetest.add_item(pos, {
name = mobs.npc_drops[math.random(1, #mobs.npc_drops)]
})
return
-- if owner switch between follow and stand
elseif self.owner and self.owner == clicker:get_player_name() then
if self.order == "follow" then
self.order = "stand"
else
self.order = "follow"
end
end
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
end
end,
})
-- spawning enable for now
mobs:spawn_specific("mobs:npc", {"default:dirt_with_grass", "default:dirt", "default:junglegrass", "default:sand"}, {"air"}, -1, 20, 30, 500000, 1, -31000, 31000, true, true)
-- register spawn egg
mobs:register_egg("mobs:npc", "Npc", "mobs_npc_male_inv.png", 1)

133
npc_female.lua Executable file
View File

@ -0,0 +1,133 @@
-- Npc by TenPlus1
mobs.npc_drops = { "farming:meat", "farming:donut", "farming:bread", "default:apple", "default:sapling", "default:junglesapling",
"shields:shield_enhanced_wood", "3d_armor:chestplate_cactus", "3d_armor:boots_bronze",
"default:sword_steel", "default:pick_steel", "default:shovel_steel", "default:bronze_ingot",
"bucket:bucket_water", "default:stick", "cavestuff:pebble_1", "building_blocks:stick",
"default:cobble", "default:gravel", "default:clay_lump", "default:sand", "default:dirt_with_grass",
"default:dirt", "default:chest", "default:torch"}
mobs:register_mob("mobs:npc_female", {
-- animal, monster, npc
type = "npc",
-- aggressive, deals 6 damage to player/monster when hit
passive = false,
group_attack = true,
damage = 4, -- 3 damages if tamed
attack_type = "dogfight",
attacks_monsters = true,
pathfinding = false,
-- health & armor
hp_min = 20,
hp_max = 20,
armor = 200,
-- textures and model
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
visual = "mesh",
mesh = "character.b3d",
drawtype = "front",
textures = {
{"mobs_npc_female.png"}, -- female by nuttmeg20
},
child_texture = {
{"mobs_npc_baby.png"}, -- derpy baby by AmirDerAssassine
},
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_fnpc", -- 2 sounds
damage = "mobs_fnpc_hit", -- 2 sounds
attack = "mobs_fnpc_attack", -- 1 sound
death = "mobs_fnpc_death", -- 1 sound
},
-- speed and jump
walk_velocity = 3,
run_velocity = 3,
jump = true,
-- drops wood and chance of apples when dead
drops = {
{name = "default:wood", chance = 1, min = 1, max = 3},
{name = "default:apple", chance = 2, min = 1, max = 2},
{name = "flowers:tulip", chance = 4, min = 1, max = 2},
{name = "flowers:rose", chance = 4, min = 1, max = 2},
{name = "default:axe_stone", chance = 6, min = 1, max = 1},
{name = "maptools:silver_coin", chance = 10, min = 1, max = 1,},
},
-- damaged by
water_damage = 0,
lava_damage = 6,
light_damage = 0,
-- follow diamond
follow = {"farming:bread", "mobs:meat", "default:diamond"},
view_range = 16,
-- set owner and order
owner = "",
order = "follow",
fear_height = 3,
-- model animation
animation = {
speed_normal = 30,
speed_run = 30,
stand_start = 0,
stand_end = 79,
walk_start = 168,
walk_end = 187,
run_start = 168,
run_end = 187,
punch_start = 200,
punch_end = 219,
},
-- right clicking with "cooked meat" or "bread" will give npc more health
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
if item:get_name() == "default:diamond" then --/MFF (Crabman|07/14/2015) tamed with diamond
if (self.diamond_count or 0) < 4 then
self.diamond_count = (self.diamond_count or 0) + 1
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
if self.diamond_count >= 4 then
self.damages = 3
self.tamed = true
self.owner = clicker:get_player_name()
end
end
return
-- feed to heal npc
elseif not mobs:feed_tame(self, clicker, 8, true, true) then
-- right clicking with gold lump drops random item from mobs.npc_drops
if item:get_name() == "default:gold_lump" then
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
local pos = self.object:getpos()
pos.y = pos.y + 0.5
minetest.add_item(pos, {
name = mobs.npc_drops[math.random(1, #mobs.npc_drops)]
})
return
-- if owner switch between follow and stand
elseif self.owner and self.owner == clicker:get_player_name() then
if self.order == "follow" then
self.order = "stand"
else
self.order = "follow"
end
end
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
end
end,
})
-- spawning enable for now
mobs:spawn_specific("mobs:npc_female", {"default:dirt_with_grass", "default:dirt", "default:junglegrass", "default:sand"}, {"air"}, -1, 20, 30, 500000, 1, -31000, 31000, true, true)
-- register spawn egg
mobs:register_egg("mobs:npc_female", "Npc", "mobs_npc_female_inv.png", 1)

69
oerkki.lua Executable file
View File

@ -0,0 +1,69 @@
-- Oerkki by PilzAdam
mobs:register_mob("mobs:oerkki", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 7 damage when player hit
passive = false,
attack_type = "dogfight",
pathfinding = false,
reach = 2,
damage = 5,
-- health & armor
hp_min = 30,
hp_max = 40,
armor = 100,
-- textures and model
collisionbox = {-0.4, -1, -0.4, 0.4, 0.9, 0.4},
visual = "mesh",
mesh = "mobs_oerkki.b3d",
textures = {
{"mobs_oerkki.png"},
{"mobs_oerkki2.png"},
},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = false,
sounds = {
random = "mobs_oerkki",
shoot_attack = "mobs_oerkki_attack",
},
-- speed and jump
walk_velocity = 1,
run_velocity = 3,
view_range = 16,
jump = true,
-- chance of dropping obsidian and coins
drops = {
{name = "default:obsidian", chance = 3, min = 1, max = 2,},
{name = "maptools:silver_coin", chance = 1, min = 1, max = 1},
},
-- damaged by
water_damage = 2,
lava_damage = 4,
light_damage = 1,
fear_height = 4,
-- model animation
animation = {
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 36,
run_start = 37,
run_end = 49,
punch_start = 37,
punch_end = 49,
speed_normal = 15,
speed_run = 15,
},
-- replace torch with air (remove)
replace_rate = 50,
replace_what = {"default:torch"},
replace_with = "air",
replace_offset = -1,
})
-- spawns on stone/sandstone between 5 and -1 light, 1 in 9000 chance, 1 in area starting at -10 and below
mobs:spawn_specific("mobs:oerkki", {"default:stone", "default:sandstone"}, {"air"}, -1, 5, 30, 9000, 1, -31000, -75, false)
-- register spawn egg
mobs:register_egg("mobs:oerkki", "Oerkki", "mobs_oerkki_inv.png", 1)

96
pig.lua Executable file
View File

@ -0,0 +1,96 @@
-- Piggy by farfadet46
mobs:register_mob("mobs:pig", {
-- animal, monster, npc, barbarian
type = "animal",
-- aggressive, does 5 damage to player when threatened
passive = false,
attack_type = "dogfight",
group_attack = true,
reach = 2,
damage = 3,
-- health & armor
hp_min = 10,
hp_max = 15,
armor = 200,
-- textures and model
collisionbox = {-0.8, -0.01, -0.8, 0.8, 1.1, 0.8},
visual = "mesh",
mesh = "mobs_pig.b3d",
drawtype = "front",
textures = {
{"mobs_pig_pink.png"},
},
visual_size = {x=1,y=1},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_pig",
attack = "mobs_pig_angry",
},
-- speed and jump
walk_velocity = 1,
run_velocity = 3,
jump = true,
-- follows apple and potato
follow = {"default:apple", "farming:potato"},
view_range = 10,
-- drops raw pork when dead
drops = {
{name = "mobs:pork_raw", chance = 1, min = 2, max = 3,},
{name = "maptools:silver_coin", chance = 10, min = 1, max = 1,},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 0,
fear_height = 2,
-- model animation
animation = {
speed_normal = 15,
stand_start = 25,
stand_end = 55,
walk_start = 60,
walk_end = 100,
punch_start = 60,
punch_end = 100,
},
-- can be tamed by feeding 8 wheat (will not attack when tamed)
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
end,
})
-- spawns on dirt or junglegrass, between 8 and 20 light, 1 in 15000 chance, 1 in area up to 31000 in height
mobs:spawn_specific("mobs:pig", {"default:dirt", "default:junglegrass", "default:dirt_with_dry_grass"}, {"air"}, 8, 20, 30, 15000, 1, -31000, 31000, true, true)
-- register spawn egg
mobs:register_egg("mobs:pig", "Pig", "mobs_pig_inv.png", 1)
-- porkchop (raw and cooked)
minetest.register_craftitem("mobs:pork_raw", {
description = "Raw Porkchop",
inventory_image = "mobs_pork_raw.png",
on_use = minetest.item_eat(4),
})
-- cooked porkchop
minetest.register_craftitem("mobs:pork_cooked", {
description = "Cooked Porkchop",
inventory_image = "mobs_pork_cooked.png",
on_use = minetest.item_eat(8),
})
minetest.register_craft({
type = "cooking",
output = "mobs:pork_cooked",
recipe = "mobs:pork_raw",
cooktime = 5,
})

138
pumpkins.lua Executable file
View File

@ -0,0 +1,138 @@
-- PumpKing by Blert2112
mobs:register_mob("mobs:pumpking", {
type = "monster",
visual = "mesh",
mesh = "mobs_pumpking.x",
textures = {
{"mobs_pumpking.png"}
},
visual_size = {x=3, y=3},
collisionbox = {-0.5, 0.00, -0.5, 0.5, 4.5, 0.5},
animation = {
speed_normal = 15, speed_run = 30,
stand_start = 165, stand_end = 210,
walk_start = 61, walk_end = 110,
run_start = 0, run_end = 50,
punch_start = 150, punch_end = 165
},
makes_footstep_sound = true,
sounds = {
random = "mobs_king"
},
hp_min = 275,
hp_max = 300,
armor = 70,
knock_back = 0,
walk_velocity = 3,
run_velocity = 4,
light_damage = 0,
water_damage = 0,
lava_damage = 0,
fall_damage = 0,
damage = 9,
pathfinding = false,
reach = 5,
attack_type = "dogfight",
view_range = 25,
stepheight = 1.1,
drops = {
-- Ressource & Decoration drops
{name = "farming:jackolantern", chance = 1, min = 1, max = 1},
{name = "default:diamondblock", chance = 2, min = 1, max = 2},
-- Hunter drops
{name = "3d_armor:helmet_hardenedleather", chance = 10, min = 1, max = 1},
{name = "3d_armor:chestplate_hardenedleather", chance = 10, min = 1, max = 1},
{name = "throwing:bow_minotaur_horn", chance = 33, min = 1, max = 1},
-- Warrior drops
{name = "3d_armor:helmet_mithril", chance = 10, min = 1, max = 1},
{name = "3d_armor:chestplate_mithril", chance = 10, min = 1, max = 1},
{name = "default:sword_mithril", chance = 33, min = 1, max = 1},
},
lifetimer = 300, -- 5 minutes
--shoot_interval = 1000, -- (lifetimer - (lifetimer / 4)), borrowed for do_custom timer
on_die = function(self)
minetest.chat_send_all("A group of players killed a PumpKing!")
end
})
mobs:register_mob("mobs:pumpboom", {
type = "monster",
visual = "mesh",
mesh = "mobs_pumpboom.x",
textures = {
{"mobs_pumpboom.png"}
},
visual_size = {x=3, y=3},
collisionbox = {-0.70, -0.3, -0.70, 0.70, 0.70, 0.70},
rotate = 270,
animation = {
speed_normal = 15, speed_run = 30,
stand_start = 0, stand_end = 30,
walk_start = 81, walk_end = 97,
run_start = 81, run_end = 97,
punch_start = 100, punch_end = 120
},
sounds = {
random = "mobs_pump"
},
hp_min = 5,
hp_max = 10,
armor = 100,
light_damage = 0,
water_damage = 0,
lava_damage = 0,
fall_damage = 0,
damage = 8,
attack_type = "explode",
group_attack = true,
do_not_project_items = true,
view_range = 15,
walk_velocity = 2,
run_velocity = 4,
drops = {
{name = "farming:pumpkin_seed", chance = 8, min = 4, max = 8}
}
})
minetest.register_node("mobs:pumpking_spawner", {
description = "Pumpkin King Spawner",
tiles = {
"farming_pumpkin_top.png",
"farming_pumpkin_top.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_face_on.png"
},
is_ground_content = false,
groups = {unbreakable = 1, mob_spawner=1},
sounds = default.node_sound_stone_defaults({
dug = {name="mobs_king", gain=0.25}
})
})
minetest.register_node("mobs:pumpboom_spawner", {
description = "Pump Boom Spawner",
tiles = {
"farming_pumpkin_top.png",
"farming_pumpkin_top.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_face_off.png"
},
is_ground_content = false,
groups = {unbreakable = 1, mob_spawner=1},
sounds = default.node_sound_stone_defaults({
dug = {name="mobs_boom", gain=0.25}
})
})
--(name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height, spawn_in_area)
-- spawn on mobs:pumpking_spawner between 1 and 20 light, interval 300, 1 chance, 1 pumpking_spawner in area up to 31000 in height
mobs:spawn_specific("mobs:pumpking", {"mobs:pumpking_spawner"}, {"air"}, 1, 20, 300, 1, 100, -31000, 31000, true)
mobs:register_egg("mobs:pumpking", "Pumpking", "mobs_pumpking_inv.png", 1)
-- spawn on mobs:pumpboom_spawner, 4 interval, 1 chance, 30 pumpboom in area
mobs:spawn_special("mobs:pumpboom", {"mobs:pumpboom_spawner"}, {"air"}, 10, 4, 30)
mobs:register_egg("mobs:pumpboom", "Pumpboom", "mobs_pumpboom_inv.png", 1)

View File

@ -1,51 +0,0 @@
MOBS REDO for MINETEST
Built from PilzAdam's original Simple Mobs with additional mobs by KrupnoPavel, Zeg9, ExeterDad and AspireMint.
This mod contains the API only for adding your own mobs into the world, so please use the additional modpacks to add animals, monsters etc.
Changelog:
- 1.29- Split original Mobs Redo into a modpack to make it easier to disable mob sets (animal, monster, npc) or simply use the Api itself for your own mod
- 1.28- New damage system added with ability for mob to be immune to weapons or healed by them :)
- 1.27- Added new sheep, lava flan and spawn egg textures. New Lava Pick tool smelts what you dig. New atan checking function.
- 1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :) also, beehive produces honey now :)
- 1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak.
- 1.24- Added feature where certain animals run away when punched (runaway = true in mob definition)
- 1.23- Added mob spawner block for admin to setup spawners in-game (place and right click to enter settings)
- 1.22- Added ability to name tamed animals and npc using nametags, also npc will attack anyone who punches them apart from owner
- 1.21- Added some more error checking to reduce serialize.h error and added height checks for falling off cliffs (thanks cmdskp)
- 1.20- Error checking added to remove bad mobs, out of map limit mobs and stop serialize.h error
- 1.19- Chickens now drop egg items instead of placing the egg, also throwing eggs result in 1/8 chance of spawning chick
- 1.18- Added docile_by_day flag so that monsters will not attack automatically during daylight hours unless hit first
- 1.17- Added 'dogshoot' attack type, shoots when out of reach, melee attack when in reach, also api tweaks and self.reach added
- 1.16- Mobs follow multiple items now, Npc's can breed
- 1.15- Added Feeding/Taming/Breeding function, right-click to pick up any sheep with X mark on them and replace with new one to fix compatibility.
- 1.14- All .self variables saved in staticdata, Fixed self.health bug
- 1.13- Added capture function (thanks blert2112) chance of picking up mob with hand; net; magic lasso, replaced some .x models with newer .b3d one's
- 1.12- Added animal ownership so that players cannot steal your tamed animals
- 1.11- Added flying mobs (and swimming), fly=true and fly_in="air" or "deafult:water_source" for fishy
- 1,10- Footstep removed (use replace), explosion routine added for exploding mobs.
- 1.09- reworked breeding routine, added mob rotation value, added footstep feature, added jumping mobs with sounds feature, added magic lasso for picking up animals
- 1.08- Mob throwing attack has been rehauled so that they can damage one another, also drops and on_die function added
- 1.07- Npc's can now be set to follow player or stand by using self.order and self.owner variables
- beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop
- 1.06- Changed recovery times after breeding, and time taken to grow up (can be sped up by feeding baby animal)
- 1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep and lastly Jordach/BSD's kitten
- 1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :)
- 1.03- Added mob drop/replace feature so that chickens can drop eggs, cow/sheep can eat grass/wheat etc.
- 1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions
- 1.01- Mobs that suffer fall damage or die in water/lava/sunlight will now drop items
- 1.0 - more work on Api so that certain mobs can float in water while some sink like a brick :)
- 0.9 - Spawn eggs added for all mobs (admin only, cannot be placed in protected areas)... Api tweaked
- 0.8 - Added sounds to monster mobs (thanks Cyberpangolin for the sfx) and also chicken sound
- 0.7 - mobs.protected switch added to api.lua, when set to 1 mobs no longer spawn in protected areas, also bug fixes
- 0.6 - Api now supports multi-textured mobs, e.g oerkki, dungeon master, rats and chickens have random skins when spawning (sheep fix TODO), also new Honey block
- 0.5 - Mobs now float in water, die from falling, and some code improvements
- 0.4 - Dungeon Masters and Mese Monsters have much better aim due to shoot_offset, also they can both shoot through nodes that aren't walkable (flowers, grass etc) plus new sheep sound :)
- 0.3 - Added LOTT's Spider mob, made Cobwebs, added KPavel's Bee with Honey and Beehives (made texture), Warthogs now have sound and can be tamed, taming of shaved sheep or milked cow with 8 wheat so it will not despawn, many bug fixes :)
- 0.2 - Cooking bucket of milk into cheese now returns empty bucket
- 0.1 - Initial Release

74
sandmonster.lua Executable file
View File

@ -0,0 +1,74 @@
-- Sand Monster by PilzAdam
mobs:register_mob("mobs:sand_monster", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 5 damage to player when hit
passive = false,
attack_type = "dogfight",
pathfinding = false,
reach = 2,
damage = 2,
-- health & armor
hp_min = 10,
hp_max = 15,
armor = 100,
-- textures and model
collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
visual = "mesh",
mesh = "mobs_sand_monster.b3d",
textures = {
{"mobs_sand_monster.png"},
},
blood_texture = "default_sand.png",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_sandmonster",
},
-- speed and jump, sinks in water
walk_velocity = 2,
run_velocity = 4,
view_range = 16,
jump = true,
floats = 0,
-- drops desert sand when dead
drops = {
{name = "default:desert_sand", chance = 1, min = 3, max = 5,},
{name = "maptools:silver_coin", chance = 10, min = 1, max = 1,},
},
-- damaged by
water_damage = 3,
lava_damage = 4,
light_damage = 0,
fear_height = 4,
-- model animation
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 39,
walk_start = 41,
walk_end = 72,
run_start = 74,
run_end = 105,
punch_start = 74,
punch_end = 105,
},
})
-- spawns on desert sand between -1 and 20 light, 1 in 25000 chance, 1 sand monster in area up to 31000 in height
mobs:spawn_specific("mobs:sand_monster", {"default:desert_sand", "default:sand"}, {"air"}, -1, 20, 30, 25000, 1, -31000, 31000, false)
-- register spawn egg
mobs:register_egg("mobs:sand_monster", "Sand Monster", "mobs_sand_monster_inv.png", 1)
minetest.register_craft({
output = "mobs:sand_monster",
recipe = {
{"group:sand", "group:sand", "group:sand"},
{"group:sand", "default:nyancat_rainbow", "group:sand"},
{"group:sand", "group:sand", "group:sand"}
}
})

100
shark.lua Executable file
View File

@ -0,0 +1,100 @@
-- local variables
local l_colors = {
"#111010:200", --dark_grey
"#101020:225", --dark_blue
"#404030:225", --cold_grey
"#404040:210", --light_grey
"#202020:210" --grey
}
local l_skins = {
{"(shark_first.png^[colorize:"..l_colors[1]..")^(shark_second.png^[colorize:"..l_colors[5]..")^shark_third.png"},
{"(shark_first.png^[colorize:"..l_colors[2]..")^(shark_second.png^[colorize:"..l_colors[5]..")^shark_third.png"},
{"(shark_first.png^[colorize:"..l_colors[3]..")^(shark_second.png^[colorize:"..l_colors[4]..")^shark_third.png"}
}
local l_anims = {
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 80,
walk_start = 80, walk_end = 160,
run_start = 80, run_end = 160
}
local l_model = "mobs_shark.b3d"
local l_egg_texture = "mobs_shark_shark_inv.png"
local l_spawn_in = {"default:water_source"}
local l_spawn_near = {"default:water_flowing","default:water_source","seawrecks:woodship","seawrecks:uboot"}
local l_spawn_chance = 1000000
-- large
mobs:register_mob("mobs:shark_lg", {
type = "monster",
attack_type = "dogfight",
damage = 4,
reach = 3,
hp_min = 15,
hp_max = 20,
armor = 150,
collisionbox = {-0.75, -0.5, -0.75, 0.75, 0.5, 0.75},
visual = "mesh",
mesh = l_model,
textures = l_skins,
makes_footstep_sound = false,
walk_velocity = 2,
run_velocity = 4,
fly = true,
fly_in = "default:water_source",
fall_speed = 0,
rotate = 270,
view_range = 10,
water_damage = 0,
lava_damage = 10,
light_damage = 0,
animation = l_anims,
do_custom = function(self)
local p = self.object:getpos()
local a = self.object:getvelocity()
if p.y > 0 and a.y > 0 then
a.y = -1
else
local r = math.random(100)
if r >= 1 and r <=25 then a.y = 0.25
elseif r > 25 and r <= 50 then a.y = 0
elseif r > 50 and r <= 75 then a.y = -0.25
end
end
self.object:setvelocity(a)
end
})
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific("mobs:shark_lg", l_spawn_in, l_spawn_near, -1, 20, 30, l_spawn_chance, 1, -50, -1)
mobs:register_egg("mobs:shark_lg", "Shark (large)", l_egg_texture, 1)
-- medium
mobs:register_mob("mobs:shark_md", {
type = "monster",
attack_type = "dogfight",
damage = 5,
reach = 2,
hp_min = 20,
hp_max = 25,
armor = 125,
collisionbox = {-0.57, -0.38, -0.57, 0.57, 0.38, 0.57},
visual = "mesh",
visual_size = {x=0.75, y=0.75},
mesh = l_model,
textures = l_skins,
makes_footstep_sound = false,
walk_velocity = 2,
run_velocity = 4,
fly = true,
fly_in = "default:water_source",
fall_speed = -1,
rotate = 270,
view_range = 10,
water_damage = 0,
lava_damage = 10,
light_damage = 0,
animation = l_anims
})
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific("mobs:shark_md", l_spawn_in, l_spawn_near, -1, 20, 30, l_spawn_chance, 1, -50, -1)
mobs:register_egg("mobs:shark_md", "Shark (medium)", l_egg_texture, 1)

215
sheep.lua Executable file
View File

@ -0,0 +1,215 @@
local all_colours = {
{"black", "Black", "#000000b0"},
{"blue", "Blue", "#015dbb70"},
{"brown", "Brown", "#663300a0"},
{"cyan", "Cyan", "#01ffd870"},
{"dark_green", "Dark Green", "#005b0770"},
{"dark_grey", "Dark Grey", "#303030b0"},
{"green", "Green", "#61ff0170"},
{"grey", "Grey", "#5b5b5bb0"},
{"magenta", "Magenta", "#ff05bb70"},
{"orange", "Orange", "#ff840170"},
{"pink", "Pink", "#ff65b570"},
{"red", "Red", "#ff0000a0"},
{"violet", "Violet", "#2000c970"},
{"white", "White", "#abababc0"},
{"yellow", "Yellow", "#e3ff0070"},
}
-- Sheep by PilzAdam, texture converted to minetest by AMMOnym from Summerfield pack
for _, col in pairs(all_colours) do
mobs:register_mob("mobs:sheep_"..col[1], {
-- animal, monster, npc, barbarian
type = "animal",
-- not aggressive
passive = true,
-- health & armor
hp_min = 8,
hp_max = 10,
armor = 200,
-- textures and model
collisionbox = {-0.5, -1, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = "mobs_sheep.b3d",
textures = {
{"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:" .. col[3] .. ")"},
},
-- specific texture and mesh for gotten
gotten_texture = {"mobs_sheep_shaved.png"},
gotten_mesh = "mobs_sheep_shaved.b3d",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_sheep",
},
-- speed and jump
walk_velocity = 1,
run_velocity = 2,
runaway = true,
jump = true,
-- drops raw meat and woll of its color when dead
drops = {
{name = "mobs:meat_raw", chance = 1, min = 2, max = 3},
{name = "wool:"..col[1], chance = 1, min = 1, max = 1},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 0,
-- model animation
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 80,
walk_start = 81,
walk_end = 100,
},
follow = {"farming:wheat", "default:grass_5"},
view_range = 8,
-- replace grass/wheat with air (eat)
replace_rate = 10,
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
replace_with = "air",
-- right click sheep to shear sheep and get wood, feed 8 wheat for wool to grow back
replace_offset = -1,
fear_height = 3,
on_rightclick = function(self, clicker)
local shpcolor = string.split(self.name,"_")[2]
if shpcolor =="dark" then
shpcolor = shpcolor.."_"..string.split(self.name,"_")[3]
end
--are we feeding?
if mobs:feed_tame(self, clicker, 8, true, true) then
--if full grow fuzz
if self.gotten == false then
self.object:set_properties({
textures = {"mobs_sheep_wool.png^[colorize:" .. col[3] .. "^mobs_sheep_base.png"},
mesh = "mobs_sheep.b3d",
})
end
return
end
local item = clicker:get_wielded_item()
local itemname = item:get_name()
--are we giving a haircut>
if itemname == "mobs:shears" then
if self.gotten == false and self.child == false then
self.gotten = true -- shaved
if minetest.get_modpath("wool") then
local pos = self.object:getpos()
pos.y = pos.y + 0.5
local obj = minetest.add_item(pos, ItemStack("wool:"..shpcolor.." "..math.random(1,3)))
if obj then
obj:setvelocity({
x = math.random(-1,1),
y = 5,
z = math.random(-1,1)
})
end
item:add_wear(650) -- 100 uses
clicker:set_wielded_item(item)
end
self.object:set_properties({
textures = {"mobs_sheep_shaved.png"},
mesh = "mobs_sheep_shaved.b3d",
})
end
return
end
local name = clicker:get_player_name()
--are we coloring?
if itemname:find("dye:") then
if self.gotten == false
and self.child == false
and self.tamed == true
and name == self.owner then
local colr = string.split(itemname,":")[2]
for _,c in pairs(all_colours) do
if c[1] == colr then
local pos = self.object:getpos()
self.object:remove()
local mob = minetest.add_entity(pos, "mobs:sheep_"..colr)
local ent = mob:get_luaentity()
ent.owner = name
ent.tamed = true
-- take item
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
break
end
end
end
return
end
--are we capturing?
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end
})
mobs:register_egg("mobs:sheep_"..col[1], col[2] .. "Sheep", "mobs_sheep_white_inv.png^[colorize:" .. col[3], 1)
end
mobs:spawn_specific("mobs:sheep_white", {"default:dirt_with_grass"}, {"air"}, 8, 20, 30, 15000, 2, -31000, 31000, true, true)
-- compatibility (item and entity)
minetest.register_alias("mobs:sheep", "mobs:sheep_white")
minetest.register_entity("mobs:sheep", {
hp_max = 1,
physical = true,
collide_with_objects = true,
visual = "mesh",
mesh = "mobs_sheep.b3d",
visual_size = {x = 1, y = 1},
textures = {"mobs_sheep_white.png"},
velocity = {x = 0, y = 0, z = 0},
collisionbox = {-0.4, -1, -0.4, 0.4, 0.3, 0.4},
is_visible = true,
on_activate = function(self, staticdata, dtime_s)
local pos = self.object:getpos()
self.object:remove()
minetest.add_entity(pos, "mobs:sheep_white")
end
})

BIN
sounds/default_punch.ogg Normal file → Executable file

Binary file not shown.

BIN
sounds/default_punch2.ogg Executable file

Binary file not shown.

BIN
sounds/mese_dragon.ogg Normal file

Binary file not shown.

BIN
sounds/mesed.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_bee.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_chicken.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_cow.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_die_yell.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_dirtmonster.1.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_dirtmonster.2.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_dungeonmaster.1.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_dungeonmaster.2.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_dungeonmaster.3.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_eerie.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_fireball.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_fnpc.1.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_fnpc.2.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_fnpc_attack.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_fnpc_death.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_fnpc_hit.1.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_fnpc_hit.2.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_howl.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_king.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_kitten.1.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_kitten.2.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_kitten.3.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_kitten.4.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_kitten.5.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_kitten.6.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_mesemonster.1.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_mesemonster.2.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_npc.1.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_npc.2.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_npc_attack.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_npc_death.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_npc_hit.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_oerkki.1.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_oerkki.2.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_oerkki_attack.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_pig.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_pig_angry.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_pump.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_sandmonster.1.ogg Executable file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More