1 --this is where mobs are defined
3 --this is going to be used to set an active mob limit
7 local path = minetest.get_modpath(minetest.get_current_modname())
9 dofile(path.."/spawning.lua")
10 dofile(path.."/api/api_hook.lua")
11 dofile(path.."/items.lua")
12 dofile(path.."/chatcommands.lua")
19 collide_with_objects = false,
20 collisionbox = {-0.37, 0, -0.37, 0.37, 0.85, 0.37},
22 visual_size = {x = 3, y = 3},
25 --blank out the first two to create adult pig
29 --these are used to anchor a point to the head position
34 debug_head_pos = false,
35 head_directional_offset = 0.5, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
36 head_height_offset = 0.8, --added to the base y position
37 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
38 head_position_correction = vector.new(0,3,-0.5),
39 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
40 head_coord = "horizontal",
45 automatic_face_movement_dir = 0,
46 automatic_face_movement_max_rotation_per_sec = 300,
47 makes_footstep_sound = false,
49 gravity = {x = 0, y = -9.81, z = 0},
50 movement_type = "walk",
55 item_drop = "mob:raw_porkchop",
56 standing_frame = {x=0,y=0},
57 moving_frame = {x=0,y=40},
58 animation_multiplier = 20,
64 die_sound = "pig_die",
68 attacked_hostile = false,
69 attack_type = "punch",
71 --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
72 --explosion_power = 7, -- how big the explosion has to be
73 --explosion_time = 3, -- how long it takes for a mob to explode
81 collide_with_objects = false,
82 collisionbox = {-0.37, 0, -0.37, 0.37, 0.85, 0.37},
84 visual_size = {x = 3, y = 3},
87 "sheep_head_wool.png","sheep_wool.png","sheep.png"
88 --"sheep_head_shaved.png","nothing.png","sheep.png"
91 --these are used to anchor a point to the head position
96 debug_head_pos = false,
97 head_directional_offset = 0.571, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
98 head_height_offset = 1.15, --added to the base y position
99 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
100 head_position_correction = vector.new(0,4.1,-0.86),
101 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
102 head_coord = "horizontal",
107 automatic_face_movement_dir = 0,
108 automatic_face_movement_max_rotation_per_sec = 300,
109 makes_footstep_sound = false,
111 gravity = {x = 0, y = -9.81, z = 0},
112 movement_type = "walk",
117 item_drop = "mob:raw_porkchop",
118 standing_frame = {x=0,y=0},
119 moving_frame = {x=0,y=40},
120 animation_multiplier = 20,
123 death_rotation = "x",
125 hurt_sound = "sheep",
130 attacked_hostile = false,
131 attack_type = "punch",
134 c_mob_data = {sheared = false},
136 custom_on_activate = function(self)
137 --print(dump(self.c_mob_data))
138 if self.c_mob_data.sheared == true then
139 self.object:set_properties({textures = {"sheep_head_shaved.png","nothing.png","sheep.png"}})
143 custom_on_punch = function(self)
144 if self.c_mob_data.sheared == false then
145 self.object:set_properties({textures = {"sheep_head_shaved.png","nothing.png","sheep.png"}})
146 self.c_mob_data = {sheared=true}
147 local pos = self.object:get_pos()
149 minetest.throw_item(pos,{name="weather:snow_block"})
159 collide_with_objects = false,
160 collisionbox = {-0.225, 0, -0.225, 0.225, 0.675, 0.225},
162 visual_size = {x = 3, y = 3},
163 mesh = "chicken.b3d",
165 --blank out the first two to create adult pig
169 --these are used to anchor a point to the head position
174 debug_head_pos = false,
175 rotational_correction = -math.pi/2,
176 head_directional_offset = 0.2, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
177 head_height_offset = 0.82, --added to the base y position
178 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
179 head_position_correction = vector.new(0,1.8,-0.89),
180 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
181 head_coord = "vertical",
187 automatic_face_movement_dir = 90,
188 automatic_face_movement_max_rotation_per_sec = 300,
189 makes_footstep_sound = false,
191 gravity = {x = 0, y = -9.81, z = 0},
192 movement_type = "walk",
197 item_drop = {"mob:egg","mob:feather"},
198 standing_frame = {x=20,y=20},
199 moving_frame = {x=0,y=20},
200 animation_multiplier = 15,
203 death_rotation = "z",
205 hurt_sound = "chicken_hurt",
206 die_sound = "chicken_die",
210 attacked_hostile = false,
211 attack_type = "punch",
213 --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
214 --explosion_power = 7, -- how big the explosion has to be
215 --explosion_time = 3, -- how long it takes for a mob to explode
223 collide_with_objects = false,
224 collisionbox = {-0.37, 0, -0.37, 0.37, 1.75, 0.37},
226 visual_size = {x = 3, y = 3},
227 mesh = "snowman.b3d",
229 "snowman.png","snowman.png","snowman.png","snowman.png","snowman.png","snowman.png",
232 --these are used to anchor a point to the head position
236 --head_bone = "Bone",
237 debug_head_pos = false,
238 head_directional_offset = 0, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
239 head_height_offset = 1.625, --added to the base y position
240 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
241 head_position_correction = vector.new(0,4.6,0),
242 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
243 head_coord = "vertical",
244 --rotational_correction = math.pi/2,
249 automatic_face_movement_dir = -90,
250 automatic_face_movement_max_rotation_per_sec = 300,
251 makes_footstep_sound = false,
253 gravity = {x = 0, y = -9.81, z = 0},
254 movement_type = "walk",
259 item_drop = {"weather:snowball","main:coal","mob:carrot","main:stick"},
260 standing_frame = {x=0,y=0},
261 moving_frame = {x=0,y=0},
262 animation_multiplier = 10,
265 death_rotation = "z",
272 attack_type = "projectile",
273 projectile_type = "weather:snowball",
274 projectile_timer_cooldown = 1,
276 custom_function = function(self,dtime,moveresult)
277 if moveresult and moveresult.touching_ground then
278 local pos = vector.floor(vector.add(self.object:get_pos(),0.5))
280 if self.custom_old_pos and not vector.equals(pos,self.custom_old_pos) then
281 if minetest.get_nodedef(minetest.get_node(pos).name,"buildable_to") == true and minetest.get_nodedef(minetest.get_node(vector.new(pos.x,pos.y-1,pos.z)).name,"buildable_to") == false then
282 minetest.set_node(pos,{name="weather:snow"})
285 self.custom_old_pos = pos
290 custom_timer_function = function(self,dtime)
291 if weather_type and weather_type ~= 1 then
292 self.object:punch(self.object, 2,
294 full_punch_interval=1.5,
295 damage_groups = {damage=2},
306 collide_with_objects = false,
307 collisionbox = {-0.37, 0, -0.37, 0.37, 0.85, 0.37},
309 visual_size = {x = 3, y = 3},
312 --blank out the first two to create adult pig
313 "phyg.png","wings.png"
316 --these are used to anchor a point to the head position
321 debug_head_pos = false,
322 head_directional_offset = 0.5, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
323 head_height_offset = 0.8, --added to the base y position
324 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
325 head_position_correction = vector.new(0,3,-0.5),
326 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
327 head_coord = "horizontal",
332 automatic_face_movement_dir = 0,
333 automatic_face_movement_max_rotation_per_sec = 300,
334 makes_footstep_sound = false,
335 takes_fall_damage = false,
336 make_jump_noise = false,
338 gravity = {x = 0, y = -1, z = 0},
339 movement_type = "walk",
344 item_drop = "main:gold",
348 standing_frame = {x=0,y=0},
349 moving_frame = {x=0,y=40},
350 animation_multiplier = 20,
353 death_rotation = "x",
356 die_sound = "pig_die",
360 attacked_hostile = false,
361 attack_type = "punch",
363 --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
364 --explosion_power = 7, -- how big the explosion has to be
365 --explosion_time = 3, -- how long it takes for a mob to explode
372 mobname = "big_slime",
374 collide_with_objects = false,
375 collisionbox = {-1.25, 0, -1.25, 1.25, 2.5, 1.25},
377 visual_size = {x = 15, y = 15},
382 collision_boundary = 2.5,
385 automatic_face_movement_dir = 90,
386 automatic_face_movement_max_rotation_per_sec = 300,
387 makes_footstep_sound = false,
389 gravity = {x = 0, y = -9.81, z = 0},
390 movement_type = "jump",
391 make_jump_noise = true,
396 death_rotation = "z",
397 hurt_sound = "slime_die",
398 die_sound = "slime_die",
399 attack_type = "punch",
401 custom_on_death = function(self)
402 local pos = self.object:get_pos()
404 minetest.add_entity(pos,"mob:medium_slime")
412 mobname = "medium_slime",
414 collide_with_objects = false,
415 collisionbox = {-0.625, 0, -0.625, 0.625, 1.25, 0.625},
417 visual_size = {x = 7.5, y = 7.5},
424 automatic_face_movement_dir = 90,
425 automatic_face_movement_max_rotation_per_sec = 300,
426 makes_footstep_sound = false,
428 gravity = {x = 0, y = -9.81, z = 0},
429 movement_type = "jump",
430 make_jump_noise = true,
435 death_rotation = "z",
436 hurt_sound = "slime_die",
437 die_sound = "slime_die",
439 attack_type = "punch",
440 custom_on_death = function(self)
441 local pos = self.object:get_pos()
444 minetest.add_entity(pos,"mob:small_slime")
452 mobname = "small_slime",
454 collide_with_objects = false,
455 collisionbox = {-0.3, 0, -0.3, 0.3, 0.6, 0.3},
457 visual_size = {x = 3.7, y = 3.7},
464 automatic_face_movement_dir = 90,
465 automatic_face_movement_max_rotation_per_sec = 300,
466 makes_footstep_sound = false,
468 gravity = {x = 0, y = -9.81, z = 0},
469 movement_type = "jump",
470 make_jump_noise = true,
475 death_rotation = "z",
476 hurt_sound = "slime_die",
477 die_sound = "slime_die",
479 attack_type = "punch",
480 item_drop = "mob:slimeball"
491 collide_with_objects = false,
492 collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
494 visual_size = {x = 3, y = 3},
497 "creepig_body.png","creepig_leg.png","creepig_leg.png","creepig_leg.png","creepig_leg.png"
501 automatic_face_movement_dir = -90.0,
502 automatic_face_movement_max_rotation_per_sec = 300,
503 makes_footstep_sound = false,
505 gravity = {x = 0, y = -9.81, z = 0},
506 movement_type = "walk",
511 item_drop = "mob:cooked_porkchop",
513 standing_frame = {x=0,y=0},
514 moving_frame = {x=5,y=15},
515 animation_multiplier = 5,
518 has_head = true, --remove this when mesh based head rotation is implemented
519 head_visual = "mesh",
520 head_visual_size = {x = 1.1, y = 1.1},
521 head_mesh = "pig_head.x",
522 head_textures ={"creepig_head.png","creepig_nose.png"},
523 head_mount = vector.new(0,1.2,1.9),
525 death_rotation = "z",
528 die_sound = "pig_die",
530 attack_type = "explode",
531 --projectile_timer_cooldown = 5,
532 --projectile_type = "tnt:tnt",
534 explosion_radius = 2, -- how far away the mob has to be to initialize the explosion
535 explosion_power = 7, -- how big the explosion has to be
536 explosion_time = 5, -- how long it takes for a mob to explode
539 die_in_light_level = 12,
549 collide_with_objects = false,
550 collisionbox = {-0.37,0, -0.37, 0.37, 1.5, 0.37},
552 visual_size = {x = 3.2, y = 3.2},
553 mesh = "creeper.b3d",
559 automatic_face_movement_max_rotation_per_sec = 300,
560 makes_footstep_sound = false,
562 gravity = {x = 0, y = -9.81, z = 0},
563 movement_type = "walk",
566 hostile_cooldown = false,
569 item_drop = "mob:gunpowder",
571 standing_frame = {x=0,y=0},
572 moving_frame = {x=0,y=40},
573 animation_multiplier = 20,
577 --these are used to anchor a point to the head position
579 automatic_face_movement_dir = 0,
581 debug_head_pos = false,
582 --this always has to be slightly positive
583 head_directional_offset = 0.01,
584 head_height_offset = 1.45, --added to the base y position
585 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
586 head_position_correction = vector.new(0,2.4,0),
587 head_coord = "vertical",
591 death_rotation = "x",
593 hurt_sound = "creeper_hurt",
594 die_sound = "creeper_hurt",
596 attack_type = "explode",
597 --projectile_timer_cooldown = 5,
598 --projectile_type = "tnt:tnt",
600 explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
601 explosion_power = 4, -- how big the explosion has to be
602 explosion_time = 3, -- how long it takes for a mob to explode
604 die_in_light = false,
605 --die_in_light_level = 12,
613 mobname = "nitro_creeper",
615 collide_with_objects = false,
616 collisionbox = {-0.37,0, -0.37, 0.37, 1.5, 0.37},
618 visual_size = {x = 3.2, y = 3.2},
619 mesh = "creeper.b3d",
625 automatic_face_movement_max_rotation_per_sec = 300,
626 makes_footstep_sound = false,
628 gravity = {x = 0, y = -9.81, z = 0},
629 movement_type = "walk",
632 hostile_cooldown = false,
635 item_drop = "mob:gunpowder",
637 damage_color = "blue",
639 standing_frame = {x=0,y=0},
640 moving_frame = {x=0,y=40},
641 animation_multiplier = 20,
645 --these are used to anchor a point to the head position
647 automatic_face_movement_dir = 0,
649 debug_head_pos = false,
650 --this always has to be slightly positive
651 head_directional_offset = 0.01,
652 head_height_offset = 1.45, --added to the base y position
653 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
654 head_position_correction = vector.new(0,2.4,0),
655 head_coord = "vertical",
659 death_rotation = "x",
661 hurt_sound = "creeper_hurt",
662 die_sound = "creeper_hurt",
664 attack_type = "explode",
665 --projectile_timer_cooldown = 5,
666 --projectile_type = "tnt:tnt",
668 explosion_radius = 6, -- how far away the mob has to be to initialize the explosion
669 explosion_power = 14, -- how big the explosion is (radius)
670 explosion_time = 3, -- how long it takes for a mob to explode
671 explosion_blink_timer = 0.1, -- how fast the blinking happens
673 die_in_light = false,
674 --die_in_light_level = 12,
683 collide_with_objects = false,
684 collisionbox = {-0.37, 0, -0.37, 0.37, 0.85, 0.37},
686 visual_size = {x = 3, y = 3},
692 --these are used to anchor a point to the head position
694 head_bone = "body.head",
695 debug_head_pos = false,
696 rotational_correction = -math.pi/2,
697 head_directional_offset = 0.3, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
698 head_height_offset = 0.63, --added to the base y position
699 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
700 head_position_correction = vector.new(0,1.24,0),
701 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
702 head_coord = "horizontal",
707 automatic_face_movement_dir = 90,
708 automatic_face_movement_max_rotation_per_sec = 300,
709 makes_footstep_sound = false,
711 gravity = {x = 0, y = -9.81, z = 0},
712 movement_type = "walk",
717 item_drop = "mob:string",
718 standing_frame = {x=21,y=21},
719 moving_frame = {x=0,y=20},
720 animation_multiplier = 20,
723 death_rotation = "z",
725 hurt_sound = "spider",
726 die_sound = "spider_die",
732 friendly_in_daylight = true,
733 attacked_hostile = true,
735 attack_type = "punch",
738 custom_on_activate = function(self)
739 if math.random() > 0.998 then
740 local obj = minetest.add_entity(self.object:get_pos(),"mob:pig")
741 local obj2 = minetest.add_entity(self.object:get_pos(),"tnt:tnt")
742 local obj3 = minetest.add_entity(self.object:get_pos(),"boat:boat")
744 obj2:get_luaentity().timer = 7
745 obj2:get_luaentity().radius = 7
747 obj:set_attach(self.object,"",vector.new(0,3,0),vector.new(0,90,0))
748 obj2:set_attach(obj,"",vector.new(0,4.5,0),vector.new(0,90,0))
749 obj3:set_attach(obj2,"",vector.new(0,6.5,0),vector.new(0,0,0))
751 obj:set_properties({visual_size={x=1,y=1}})
752 obj2:set_properties({visual_size={x=1/3,y=1/3}})
755 --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
756 --explosion_power = 7, -- how big the explosion has to be
757 --explosion_time = 3, -- how long it takes for a mob to explode