mob_register.explosion_blink_timer = def.explosion_blink_timer or 0.2
mob_register.custom_function_begin = def.custom_function_begin
+mob_register.custom_function = def.custom_function
mob_register.custom_function_end = def.custom_function_end
+
mob_register.projectile_timer_cooldown = def.projectile_timer_cooldown
mob_register.attacked_hostile = def.attacked_hostile
mob_register.pathfinding_timer = 0
end
+if def.custom_timer then
+ mob_register.c_timer = 0
+ mob_register.custom_timer = def.custom_timer
+ mob_register.custom_timer_function = def.custom_timer_function
+end
+
mobs.create_movement_functions(def,mob_register)
mobs.create_interaction_functions(def,mob_register)
mobs.create_data_handling_functions(def,mob_register)
end
if self.dead == false and self.death_animation_timer == 0 then
+ if self.do_custom_timer then
+ self.do_custom_timer(self,dtime)
+ end
+
+ if self.custom_function then
+ self.custom_function(self,dtime,moveresult)
+ end
+
self.move(self,dtime,moveresult)
+
--self.debug_nametag(self,dtime)
+
self.manage_hurt_color_timer(self,dtime)
+
if self.set_animation then
self.set_animation(self)
end
end
return(mob_register)
-end
+end
\ No newline at end of file
end
end
+ if def.custom_timer then
+ mob_register.do_custom_timer = function(self,dtime)
+ self.c_timer = self.c_timer + dtime
+ if self.c_timer >= self.custom_timer then
+ self.c_timer = 0
+ self.custom_timer_function(self,dtime)
+ end
+ end
+ end
+
mob_register.manage_projectile_timer = function(self,dtime)
self.projectile_timer = self.projectile_timer - dtime
end
-----
- --head_bone = "head",
+ --head_bone = "Bone",
debug_head_pos = false,
head_directional_offset = 0, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
head_height_offset = 1.625, --added to the base y position
is_visible = true,
pointable = true,
- automatic_face_movement_dir = 0,
+ automatic_face_movement_dir = -90,
automatic_face_movement_max_rotation_per_sec = 300,
makes_footstep_sound = false,
hp = 10,
animation_multiplier = 10,
----
----
- death_rotation = "x",
+ death_rotation = "z",
hurt_sound = "wool",
die_sound = "wool",
projectile_type = "weather:snowball",
projectile_timer_cooldown = 1,
+ custom_function = function(self,dtime,moveresult)
+ if moveresult and moveresult.touching_ground then
+ local pos = vector.floor(vector.add(self.object:get_pos(),0.5))
+
+ if self.custom_old_pos and not vector.equals(pos,self.custom_old_pos) then
+ 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
+ minetest.set_node(pos,{name="weather:snow"})
+ end
+ end
+ self.custom_old_pos = pos
+ end
+ end,
+
+ custom_timer = 0.75,
+ custom_timer_function = function(self,dtime)
+ if weather_type and weather_type ~= 1 then
+ self.object:punch(self.object, 2,
+ {
+ full_punch_interval=1.5,
+ damage_groups = {damage=2},
+ })
+ end
+ end,
}
)
These are pulled from multiple mods from 22i https://github.com/22i, also thank you 22i for attributing me to OpenAI
Currently:
-pig - https://github.com/22i/minecraft-voxel-blender-models
+pig,creeper,nitro_creeper,spider - https://github.com/22i/minecraft-voxel-blender-models
+
+snowman - Originally by 22i (see above) redone by ElCeejo https://github.com/ElCeejo Thanks!
+