-
-
-if def.has_head == true then
- mob_register.head = {}
- mob_register.head.initial_properties = {
- hp_max = 1,
- physical = false,
- collide_with_objects = false,
- collisionbox = {0, 0, 0, 0, 0, 0},
- visual = def.head_visual,
- visual_size = def.head_visual_size,
- mesh = def.head_mesh,
- textures = def.head_textures,
- is_visible = true,
- pointable = false,
- --automatic_face_movement_dir = 0.0,
- --automatic_face_movement_max_rotation_per_sec = 600,
- }
-
- --remove the head if no body
- mob_register.head.on_step = function(self, dtime)
- if self.parent == nil then
- self.object:remove()
- end
- end
- minetest.register_entity("mob:head"..def.mobname, mob_register.head)
-end