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","mob:feather"},
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","main:coal","mob:carrot","main:stick"},
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",
324 custom_on_death = function(self)
325 local pos = self.object:get_pos()
327 minetest.add_entity(pos,"mob:medium_slime")
335 mobname = "medium_slime",
337 collide_with_objects = false,
338 collisionbox = {-0.625, 0, -0.625, 0.625, 1.25, 0.625},
340 visual_size = {x = 7.5, y = 7.5},
347 automatic_face_movement_dir = 90,
348 automatic_face_movement_max_rotation_per_sec = 300,
349 makes_footstep_sound = false,
351 gravity = {x = 0, y = -9.81, z = 0},
352 movement_type = "jump",
353 make_jump_noise = true,
358 death_rotation = "z",
359 hurt_sound = "slime_die",
360 die_sound = "slime_die",
362 attack_type = "punch",
363 custom_on_death = function(self)
364 local pos = self.object:get_pos()
367 minetest.add_entity(pos,"mob:small_slime")
375 mobname = "small_slime",
377 collide_with_objects = false,
378 collisionbox = {-0.3, 0, -0.3, 0.3, 0.6, 0.3},
380 visual_size = {x = 3.7, y = 3.7},
387 automatic_face_movement_dir = 90,
388 automatic_face_movement_max_rotation_per_sec = 300,
389 makes_footstep_sound = false,
391 gravity = {x = 0, y = -9.81, z = 0},
392 movement_type = "jump",
393 make_jump_noise = true,
398 death_rotation = "z",
399 hurt_sound = "slime_die",
400 die_sound = "slime_die",
402 attack_type = "punch",
403 item_drop = "mob:slimeball"
414 collide_with_objects = false,
415 collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
417 visual_size = {x = 3, y = 3},
420 "creepig_body.png","creepig_leg.png","creepig_leg.png","creepig_leg.png","creepig_leg.png"
424 automatic_face_movement_dir = -90.0,
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 = "walk",
434 item_drop = "mob:cooked_porkchop",
436 standing_frame = {x=0,y=0},
437 moving_frame = {x=5,y=15},
438 animation_multiplier = 5,
441 has_head = true, --remove this when mesh based head rotation is implemented
442 head_visual = "mesh",
443 head_visual_size = {x = 1.1, y = 1.1},
444 head_mesh = "pig_head.x",
445 head_textures ={"creepig_head.png","creepig_nose.png"},
446 head_mount = vector.new(0,1.2,1.9),
448 death_rotation = "z",
451 die_sound = "pig_die",
453 attack_type = "explode",
454 --projectile_timer_cooldown = 5,
455 --projectile_type = "tnt:tnt",
457 explosion_radius = 2, -- how far away the mob has to be to initialize the explosion
458 explosion_power = 7, -- how big the explosion has to be
459 explosion_time = 5, -- how long it takes for a mob to explode
462 die_in_light_level = 12,
472 collide_with_objects = false,
473 collisionbox = {-0.37,0, -0.37, 0.37, 1.5, 0.37},
475 visual_size = {x = 3.2, y = 3.2},
476 mesh = "creeper.b3d",
482 automatic_face_movement_max_rotation_per_sec = 300,
483 makes_footstep_sound = false,
485 gravity = {x = 0, y = -9.81, z = 0},
486 movement_type = "walk",
489 hostile_cooldown = false,
492 item_drop = "mob:gunpowder",
494 standing_frame = {x=0,y=0},
495 moving_frame = {x=0,y=40},
496 animation_multiplier = 20,
500 --these are used to anchor a point to the head position
502 automatic_face_movement_dir = 0,
504 debug_head_pos = false,
505 --this always has to be slightly positive
506 head_directional_offset = 0.01,
507 head_height_offset = 1.45, --added to the base y position
508 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
509 head_position_correction = vector.new(0,2.4,0),
510 head_coord = "vertical",
514 death_rotation = "x",
516 hurt_sound = "creeper_hurt",
517 die_sound = "creeper_hurt",
519 attack_type = "explode",
520 --projectile_timer_cooldown = 5,
521 --projectile_type = "tnt:tnt",
523 explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
524 explosion_power = 4, -- how big the explosion has to be
525 explosion_time = 3, -- how long it takes for a mob to explode
527 die_in_light = false,
528 --die_in_light_level = 12,
536 mobname = "nitro_creeper",
538 collide_with_objects = false,
539 collisionbox = {-0.37,0, -0.37, 0.37, 1.5, 0.37},
541 visual_size = {x = 3.2, y = 3.2},
542 mesh = "creeper.b3d",
548 automatic_face_movement_max_rotation_per_sec = 300,
549 makes_footstep_sound = false,
551 gravity = {x = 0, y = -9.81, z = 0},
552 movement_type = "walk",
555 hostile_cooldown = false,
558 item_drop = "mob:gunpowder",
560 damage_color = "blue",
562 standing_frame = {x=0,y=0},
563 moving_frame = {x=0,y=40},
564 animation_multiplier = 20,
568 --these are used to anchor a point to the head position
570 automatic_face_movement_dir = 0,
572 debug_head_pos = false,
573 --this always has to be slightly positive
574 head_directional_offset = 0.01,
575 head_height_offset = 1.45, --added to the base y position
576 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
577 head_position_correction = vector.new(0,2.4,0),
578 head_coord = "vertical",
582 death_rotation = "x",
584 hurt_sound = "creeper_hurt",
585 die_sound = "creeper_hurt",
587 attack_type = "explode",
588 --projectile_timer_cooldown = 5,
589 --projectile_type = "tnt:tnt",
591 explosion_radius = 6, -- how far away the mob has to be to initialize the explosion
592 explosion_power = 14, -- how big the explosion is (radius)
593 explosion_time = 3, -- how long it takes for a mob to explode
594 explosion_blink_timer = 0.1, -- how fast the blinking happens
596 die_in_light = false,
597 --die_in_light_level = 12,
606 collide_with_objects = false,
607 collisionbox = {-0.37, 0, -0.37, 0.37, 0.85, 0.37},
609 visual_size = {x = 3, y = 3},
615 --these are used to anchor a point to the head position
617 head_bone = "body.head",
618 debug_head_pos = false,
619 rotational_correction = -math.pi/2,
620 head_directional_offset = 0.3, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
621 head_height_offset = 0.63, --added to the base y position
622 --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
623 head_position_correction = vector.new(0,1.24,0),
624 --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
625 head_coord = "horizontal",
630 automatic_face_movement_dir = 90,
631 automatic_face_movement_max_rotation_per_sec = 300,
632 makes_footstep_sound = false,
634 gravity = {x = 0, y = -9.81, z = 0},
635 movement_type = "walk",
640 item_drop = "mob:string",
641 standing_frame = {x=21,y=21},
642 moving_frame = {x=0,y=20},
643 animation_multiplier = 20,
646 death_rotation = "z",
648 hurt_sound = "spider",
649 die_sound = "spider_die",
655 friendly_in_daylight = true,
656 attacked_hostile = true,
658 attack_type = "punch",
661 custom_on_activate = function(self)
662 if math.random() > 0.998 then
663 local obj = minetest.add_entity(self.object:get_pos(),"mob:pig")
664 local obj2 = minetest.add_entity(self.object:get_pos(),"tnt:tnt")
665 local obj3 = minetest.add_entity(self.object:get_pos(),"boat:boat")
667 obj2:get_luaentity().timer = 7
668 obj2:get_luaentity().radius = 7
670 obj:set_attach(self.object,"",vector.new(0,3,0),vector.new(0,90,0))
671 obj2:set_attach(obj,"",vector.new(0,4.5,0),vector.new(0,90,0))
672 obj3:set_attach(obj2,"",vector.new(0,6.5,0),vector.new(0,0,0))
674 obj:set_properties({visual_size={x=1,y=1}})
675 obj2:set_properties({visual_size={x=1/3,y=1/3}})
678 --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
679 --explosion_power = 7, -- how big the explosion has to be
680 --explosion_time = 3, -- how long it takes for a mob to explode