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
82 collide_with_objects = false,
83 collisionbox = {-0.225, 0, -0.225, 0.225, 0.675, 0.225},
85 visual_size = {x = 3, y = 3},
88 --blank out the first two to create adult pig
92 --these are used to anchor a point to the head position
97 debug_head_pos = false,
98 rotational_correction = -math.pi/2,
99 head_directional_offset = 0.2, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
100 head_height_offset = 0.82, --added to the base y position
101 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
102 head_position_correction = vector.new(0,1.8,-0.89),
103 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
104 head_coord = "vertical",
110 automatic_face_movement_dir = 90,
111 automatic_face_movement_max_rotation_per_sec = 300,
112 makes_footstep_sound = false,
114 gravity = {x = 0, y = -9.81, z = 0},
115 movement_type = "walk",
120 item_drop = "mob:egg",
121 standing_frame = {x=20,y=20},
122 moving_frame = {x=0,y=20},
123 animation_multiplier = 15,
126 death_rotation = "z",
128 hurt_sound = "chicken_hurt",
129 die_sound = "chicken_die",
133 attacked_hostile = false,
134 attack_type = "punch",
136 --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
137 --explosion_power = 7, -- how big the explosion has to be
138 --explosion_time = 3, -- how long it takes for a mob to explode
146 collide_with_objects = false,
147 collisionbox = {-0.37, 0, -0.37, 0.37, 1.75, 0.37},
149 visual_size = {x = 3, y = 3},
150 mesh = "snowman.b3d",
152 "snowman.png","snowman.png","snowman.png","snowman.png","snowman.png","snowman.png",
155 --these are used to anchor a point to the head position
159 --head_bone = "Bone",
160 debug_head_pos = false,
161 head_directional_offset = 0, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
162 head_height_offset = 1.625, --added to the base y position
163 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
164 head_position_correction = vector.new(0,4.6,0),
165 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
166 head_coord = "vertical",
167 --rotational_correction = math.pi/2,
172 automatic_face_movement_dir = -90,
173 automatic_face_movement_max_rotation_per_sec = 300,
174 makes_footstep_sound = false,
176 gravity = {x = 0, y = -9.81, z = 0},
177 movement_type = "walk",
182 item_drop = "weather:snowball",
183 standing_frame = {x=0,y=0},
184 moving_frame = {x=0,y=0},
185 animation_multiplier = 10,
188 death_rotation = "z",
195 attack_type = "projectile",
196 projectile_type = "weather:snowball",
197 projectile_timer_cooldown = 1,
199 custom_function = function(self,dtime,moveresult)
200 if moveresult and moveresult.touching_ground then
201 local pos = vector.floor(vector.add(self.object:get_pos(),0.5))
203 if self.custom_old_pos and not vector.equals(pos,self.custom_old_pos) then
204 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
205 minetest.set_node(pos,{name="weather:snow"})
208 self.custom_old_pos = pos
213 custom_timer_function = function(self,dtime)
214 if weather_type and weather_type ~= 1 then
215 self.object:punch(self.object, 2,
217 full_punch_interval=1.5,
218 damage_groups = {damage=2},
229 collide_with_objects = false,
230 collisionbox = {-0.37, 0, -0.37, 0.37, 0.85, 0.37},
232 visual_size = {x = 3, y = 3},
235 --blank out the first two to create adult pig
236 "phyg.png","wings.png"
239 --these are used to anchor a point to the head position
244 debug_head_pos = false,
245 head_directional_offset = 0.5, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
246 head_height_offset = 0.8, --added to the base y position
247 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
248 head_position_correction = vector.new(0,3,-0.5),
249 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
250 head_coord = "horizontal",
255 automatic_face_movement_dir = 0,
256 automatic_face_movement_max_rotation_per_sec = 300,
257 makes_footstep_sound = false,
258 takes_fall_damage = false,
259 make_jump_noise = false,
261 gravity = {x = 0, y = -1, z = 0},
262 movement_type = "walk",
267 item_drop = "main:gold",
271 standing_frame = {x=0,y=0},
272 moving_frame = {x=0,y=40},
273 animation_multiplier = 20,
276 death_rotation = "x",
279 die_sound = "pig_die",
283 attacked_hostile = false,
284 attack_type = "punch",
286 --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
287 --explosion_power = 7, -- how big the explosion has to be
288 --explosion_time = 3, -- how long it takes for a mob to explode
295 mobname = "big_slime",
297 collide_with_objects = false,
298 collisionbox = {-1.25, 0, -1.25, 1.25, 2.5, 1.25},
300 visual_size = {x = 15, y = 15},
305 collision_boundary = 2.5,
308 automatic_face_movement_dir = 90,
309 automatic_face_movement_max_rotation_per_sec = 300,
310 makes_footstep_sound = false,
312 gravity = {x = 0, y = -9.81, z = 0},
313 movement_type = "jump",
314 make_jump_noise = true,
319 death_rotation = "z",
320 hurt_sound = "slime_die",
321 die_sound = "slime_die",
322 attack_type = "punch",
323 custom_on_death = function(self)
324 local pos = self.object:get_pos()
326 minetest.add_entity(pos,"mob:medium_slime")
334 mobname = "medium_slime",
336 collide_with_objects = false,
337 collisionbox = {-0.625, 0, -0.625, 0.625, 1.25, 0.625},
339 visual_size = {x = 7.5, y = 7.5},
346 automatic_face_movement_dir = 90,
347 automatic_face_movement_max_rotation_per_sec = 300,
348 makes_footstep_sound = false,
350 gravity = {x = 0, y = -9.81, z = 0},
351 movement_type = "jump",
352 make_jump_noise = true,
357 death_rotation = "z",
358 hurt_sound = "slime_die",
359 die_sound = "slime_die",
360 attack_type = "punch",
361 custom_on_death = function(self)
362 local pos = self.object:get_pos()
365 minetest.add_entity(pos,"mob:small_slime")
373 mobname = "small_slime",
375 collide_with_objects = false,
376 collisionbox = {-0.3, 0, -0.3, 0.3, 0.6, 0.3},
378 visual_size = {x = 3.7, y = 3.7},
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",
400 item_drop = "mob:slimeball"
411 collide_with_objects = false,
412 collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
414 visual_size = {x = 3, y = 3},
417 "creepig_body.png","creepig_leg.png","creepig_leg.png","creepig_leg.png","creepig_leg.png"
421 automatic_face_movement_dir = -90.0,
422 automatic_face_movement_max_rotation_per_sec = 300,
423 makes_footstep_sound = false,
425 gravity = {x = 0, y = -9.81, z = 0},
426 movement_type = "walk",
431 item_drop = "mob:cooked_porkchop",
433 standing_frame = {x=0,y=0},
434 moving_frame = {x=5,y=15},
435 animation_multiplier = 5,
438 has_head = true, --remove this when mesh based head rotation is implemented
439 head_visual = "mesh",
440 head_visual_size = {x = 1.1, y = 1.1},
441 head_mesh = "pig_head.x",
442 head_textures ={"creepig_head.png","creepig_nose.png"},
443 head_mount = vector.new(0,1.2,1.9),
445 death_rotation = "z",
448 die_sound = "pig_die",
450 attack_type = "explode",
451 --projectile_timer_cooldown = 5,
452 --projectile_type = "tnt:tnt",
454 explosion_radius = 2, -- how far away the mob has to be to initialize the explosion
455 explosion_power = 7, -- how big the explosion has to be
456 explosion_time = 5, -- how long it takes for a mob to explode
459 die_in_light_level = 12,
469 collide_with_objects = false,
470 collisionbox = {-0.37,0, -0.37, 0.37, 1.5, 0.37},
472 visual_size = {x = 3.2, y = 3.2},
473 mesh = "creeper.b3d",
479 automatic_face_movement_max_rotation_per_sec = 300,
480 makes_footstep_sound = false,
482 gravity = {x = 0, y = -9.81, z = 0},
483 movement_type = "walk",
486 hostile_cooldown = false,
489 item_drop = "mob:gunpowder",
491 standing_frame = {x=0,y=0},
492 moving_frame = {x=0,y=40},
493 animation_multiplier = 20,
497 --these are used to anchor a point to the head position
499 automatic_face_movement_dir = 0,
501 debug_head_pos = false,
502 --this always has to be slightly positive
503 head_directional_offset = 0.01,
504 head_height_offset = 1.45, --added to the base y position
505 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
506 head_position_correction = vector.new(0,2.4,0),
507 head_coord = "vertical",
511 death_rotation = "x",
513 hurt_sound = "creeper_hurt",
514 die_sound = "creeper_hurt",
516 attack_type = "explode",
517 --projectile_timer_cooldown = 5,
518 --projectile_type = "tnt:tnt",
520 explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
521 explosion_power = 4, -- how big the explosion has to be
522 explosion_time = 3, -- how long it takes for a mob to explode
524 die_in_light = false,
525 --die_in_light_level = 12,
533 mobname = "nitro_creeper",
535 collide_with_objects = false,
536 collisionbox = {-0.37,0, -0.37, 0.37, 1.5, 0.37},
538 visual_size = {x = 3.2, y = 3.2},
539 mesh = "creeper.b3d",
545 automatic_face_movement_max_rotation_per_sec = 300,
546 makes_footstep_sound = false,
548 gravity = {x = 0, y = -9.81, z = 0},
549 movement_type = "walk",
552 hostile_cooldown = false,
555 item_drop = "mob:gunpowder",
557 damage_color = "blue",
559 standing_frame = {x=0,y=0},
560 moving_frame = {x=0,y=40},
561 animation_multiplier = 20,
565 --these are used to anchor a point to the head position
567 automatic_face_movement_dir = 0,
569 debug_head_pos = false,
570 --this always has to be slightly positive
571 head_directional_offset = 0.01,
572 head_height_offset = 1.45, --added to the base y position
573 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
574 head_position_correction = vector.new(0,2.4,0),
575 head_coord = "vertical",
579 death_rotation = "x",
581 hurt_sound = "creeper_hurt",
582 die_sound = "creeper_hurt",
584 attack_type = "explode",
585 --projectile_timer_cooldown = 5,
586 --projectile_type = "tnt:tnt",
588 explosion_radius = 6, -- how far away the mob has to be to initialize the explosion
589 explosion_power = 14, -- how big the explosion is (radius)
590 explosion_time = 3, -- how long it takes for a mob to explode
591 explosion_blink_timer = 0.1, -- how fast the blinking happens
593 die_in_light = false,
594 --die_in_light_level = 12,
603 collide_with_objects = false,
604 collisionbox = {-0.37, 0, -0.37, 0.37, 0.85, 0.37},
606 visual_size = {x = 3, y = 3},
612 --these are used to anchor a point to the head position
614 head_bone = "body.head",
615 debug_head_pos = false,
616 rotational_correction = -math.pi/2,
617 head_directional_offset = 0.3, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
618 head_height_offset = 0.63, --added to the base y position
619 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
620 head_position_correction = vector.new(0,1.24,0),
621 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
622 head_coord = "horizontal",
627 automatic_face_movement_dir = 90,
628 automatic_face_movement_max_rotation_per_sec = 300,
629 makes_footstep_sound = false,
631 gravity = {x = 0, y = -9.81, z = 0},
632 movement_type = "walk",
637 item_drop = "mob:string",
638 standing_frame = {x=21,y=21},
639 moving_frame = {x=0,y=20},
640 animation_multiplier = 20,
643 death_rotation = "z",
645 hurt_sound = "spider",
646 die_sound = "spider_die",
652 friendly_in_daylight = true,
653 attacked_hostile = true,
654 attack_type = "punch",
657 custom_on_activate = function(self)
658 if math.random() > 0.998 then
659 local obj = minetest.add_entity(self.object:get_pos(),"mob:pig")
660 local obj2 = minetest.add_entity(self.object:get_pos(),"tnt:tnt")
661 local obj3 = minetest.add_entity(self.object:get_pos(),"boat:boat")
663 obj2:get_luaentity().timer = 7
664 obj2:get_luaentity().radius = 7
666 obj:set_attach(self.object,"",vector.new(0,3,0),vector.new(0,90,0))
667 obj2:set_attach(obj,"",vector.new(0,4.5,0),vector.new(0,90,0))
668 obj3:set_attach(obj2,"",vector.new(0,6.5,0),vector.new(0,0,0))
670 obj:set_properties({visual_size={x=1,y=1}})
671 obj2:set_properties({visual_size={x=1/3,y=1/3}})
674 --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
675 --explosion_power = 7, -- how big the explosion has to be
676 --explosion_time = 3, -- how long it takes for a mob to explode