code:
-- Items and drops for the clownfish.

-- Register Raw Clownfish.
minetest.register_craftitem("mobs_creatures:clownfish_raw", {
        description = "Raw Clownfish",
        inventory_image = "mobs_creatures_items_clownfish_raw.png",
        on_use = minetest.item_eat(2),
        groups = {food_fish_raw = 1, flammable = 2},
})

-- Regiser Cooked Clownfish.
minetest.register_craftitem("mobs_creatures:clownfish_cooked", {
        description = "Cooked Clownfish",
        inventory_image = "mobs_creatures_items_clownfish_cooked.png",
        on_use = minetest.item_eat(6),
        groups = {food_fish = 1, flammable = 2},
})

-- Regiser cooking recipe for raw clownfish to cooked clownfish.
minetest.register_craft({
        type = "cooking",
        output = "mobs_creatures:clownfish_cooked",
        recipe = "mobs_creatures:clownfish_raw",
        cooktime = 10,
})


code:
-- Items and drops for the Cod fish.

-- Register Raw Cod.
minetest.register_craftitem("mobs_creatures:cod_raw", {
        description = "Raw Cod",
        inventory_image = "mobs_creatures_items_cod_raw.png",
        on_use = minetest.item_eat(2),
        groups = {food_fish_raw = 1, flammable = 2},
})

-- Regiser Cooked Cod.
minetest.register_craftitem("mobs_creatures:cod_cooked", {
        description = "Cooked Cod",
        inventory_image = "mobs_creatures_items_cod_cooked.png",
        on_use = minetest.item_eat(6),
        groups = {food_fish = 1, flammable = 2},
})

-- Regiser cooking recipe for raw Cod to cooked Cod.
minetest.register_craft({
        type = "cooking",
        output = "mobs_creatures:cod_cooked",
        recipe = "mobs_creatures:cod_raw",
        cooktime = 10,
})

repo_name: korkut/MeseCraft

license: mit


code:
-- Graves are from church modpack. Edited to use simple text. Used for ghosts+zombies and maybe other deathly functions.

screwdriver = screwdriver or {}

grave = {}

--Register Gravestone node.
minetest.register_node("mobs_creatures:gravestone", {
        description = "Gravestone",
        tiles = {"default_stone.png", "default_stone.png",
        "default_stone.png", "default_stone.png",
        "default_stone.png", "default_stone.png"},
        groups = {cracky = 3, oddly_breakable_by_hand = 2, choppy =1, gravestone = 1,},
        drawtype = "nodebox",
        paramtype = "light",
        paramtype2 = "facedir",
        sunlight_propagates = true,
        is_ground_content = false,
        buildable_to = false,
        --light_source = 1,
        sounds = default.node_sound_stone_defaults(),
        node_box = {
                type = "fixed",
                fixed = {
                        {-0.3125, -0.3125, -0.125, 0.3125, 0.3125, 0.125},
                        {-0.375, -0.4375, -0.1875, 0.375, -0.3125, 0.1875},
                        {-0.4375, -0.5, -0.25, 0.4375, -0.4375, 0.25},
                        {-0.25, 0.3125, -0.125, 0.25, 0.375, 0.125},
                        {-0.125, 0.375, -0.125, 0.125, 0.4375, 0.125},
                }
        },
        selection_box = {
                type = "fixed",
                fixed = {
                        {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
                }
        },
        on_construct =  function(pos)
                local meta = minetest.get_meta(pos)
                meta:set_string("formspec", "field[text;;${text}]")
                meta:set_string("infotext", "\"\"")
        end,
        on_receive_fields = function(pos, formname, fields, sender)
                local meta = minetest.get_meta(pos)
                fields.text = fields.text or ""
                print((sender:get_player_name() or "").." wrote \""..fields.text..
                                "\" to sign at "..minetest.pos_to_string(pos))
                meta:set_string("text", fields.text)
                meta:set_string("infotext", '"'..fields.text..'"')
        end,
})
-- Register Cross Gravestone
minetest.register_node("mobs_creatures:gravestone_cross", {
        description = "Cross Gravestone",
        tiles = {"default_stone.png", "default_stone.png",
        "default_stone.png", "default_stone.png",
        "default_stone.png", "default_stone.png"},
        groups = {cracky = 3, oddly_breakable_by_hand = 2, choppy =1, gravestone = 1,},
        drawtype = "nodebox",
        paramtype = "light",
        paramtype2 = "facedir",
        sunlight_propagates = true,
        is_ground_content = false,
        buildable_to = false,
        --light_source = 1,
        sounds = default.node_sound_stone_defaults(),
        on_rotate = screwdriver.rotate_simple,
        node_box = {
                type = "fixed",
                fixed = {
                        {-0.125, -0.25, -0.125, 0.125, 0.5, 0.125},
                        {-0.3125, 0.0625, -0.125, 0.3125, 0.3125, 0.125},
                        {-0.1875, -0.375, -0.1875, 0.1875, -0.25, 0.1875},
                        {-0.3125, -0.5, -0.3125, 0.3125, -0.375, 0.3125},
                }
        },
        selection_box = {
                type = "fixed",
                fixed = {
                        {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
                }
        },
        on_construct =  function(pos)
                --local n = minetest.get_node(pos)
                local meta = minetest.get_meta(pos)
                meta:set_string("formspec", "field[text;;${text}]")
                meta:set_string("infotext", "\"\"")
        end,
        on_receive_fields = function(pos, formname, fields, sender)
                --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
                local meta = minetest.get_meta(pos)
                fields.text = fields.text or ""
                print((sender:get_player_name() or "").." wrote \""..fields.text..
                                "\" to sign at "..minetest.pos_to_string(pos))
                meta:set_string("text", fields.text)
                meta:set_string("infotext", '"'..fields.text..'"')
        end,
})

-----------
--Crafting
-----------
minetest.register_craft({
        output = "mobs_creatures:gravestone",
        recipe = {
                { "", "default:stone", "" },
                { "default:stone", "signs:sign", "default:stone" },
                { "default:stone", "default:stone", "default:stone" },
        }
})

minetest.register_craft({
        output = "mobs_creatures:gravestone_cross",
        recipe = {
                { "", "default:stone", "" },
                { "default:stone", "signs:sign", "default:stone" },
                { "", "default:stone", "" },
        }
})


code:
-- Bucket of Milk
minetest.register_craftitem("mobs_creatures:milk_bucket", {
        description = "Bucket of Milk",
        inventory_image = "mobs_creatures_items_milk_bucket.png",
        stack_max = 1,
        on_use = minetest.item_eat(8, 'mesecraft_bucket:bucket_empty'),
        groups = {food_milk = 1, flammable = 3},
})

-- Glass of Milk
minetest.register_craftitem("mobs_creatures:milk_glass", {
        description = "Glass of Milk",
        inventory_image = "mobs_creatures_items_milk_glass.png",
        on_use = minetest.item_eat(2, 'vessels:drinking_glass'),
        groups = {food_milk_glass = 1, flammable = 3, vessel = 1},
})

-- 4 glasses + milk bucket --> 4 milk glasses.
minetest.register_craft({
        type = "shapeless",
        output = "mobs_creatures:milk_glass 4",
        recipe = {
                'vessels:drinking_glass', 'vessels:drinking_glass',
                'vessels:drinking_glass', 'vessels:drinking_glass',
                'mobs_creatures:milk_bucket'
        },
        replacements = { {"mobs_creatures:milk_bucket", "mesecraft_bucket:bucket_empty"} }
})

-- Glasses of Milk --> Milk Bucket.
minetest.register_craft({
        type = "shapeless",
        output = "mobs_creatures:milk_bucket",
        recipe = {
                'mobs_creatures:milk_glass', 'mobs_creatures:milk_glass',
                'mobs_creatures:milk_glass', 'mobs_creatures:milk_glass',
                'mesecraft_bucket:bucket_empty'
        },
        replacements = { {"mobs_creatures:milk_glass", "vessels:drinking_glass 4"} }
})


code:
-- raw mutton
minetest.register_craftitem("mobs_creatures:mutton_raw", {
        description = "Raw Mutton",
        inventory_image = "mobs_creatures_items_mutton_raw.png",
        on_use = minetest.item_eat(2),
        groups = {food_meat_raw = 1, food_mutton_raw = 1, flammable = 2},
})

-- cooked mutton
minetest.register_craftitem("mobs_creatures:mutton_cooked", {
        description = "Cooked Mutton",
        inventory_image = "mobs_creatures_items_mutton_cooked.png",
        on_use = minetest.item_eat(6),
        groups = {food_meat = 1, food_mutton = 1, flammable = 2},
})

minetest.register_craft({
        type = "cooking",
        output = "mobs_creatures:mutton_cooked",
        recipe = "mobs_creatures:mutton_raw",
        cooktime = 5,
})


code:
-- I've removed the abm's and player poop functionality entirely and just kept the items.
-- Plans: Add poop from animals that can be used for compost, biofuel, and fertilizer.
-- Credit to the pooper mod for these.

-- Register Nodes

minetest.register_node("mobs_creatures:poop_pile", {
	description = "Pile of Poop",
	tiles = {"mobs_creatures_items_poop_pile.png"},
	groups = {crumbly = 3, soil = 1, falling_node = 1},
	drop = "mobs_creatures:poop_turd" .. " 4",
	sounds = default.node_sound_dirt_defaults(),
})

-- Register Crafts

minetest.register_craftitem("mobs_creatures:poop_turd", {
	description = "Poop",
	inventory_image = "mobs_creatures_items_poop_turd.png",
	on_use = minetest.item_eat(1)
})

minetest.register_craft({
	output = "mobs_creatures:poop_pile",
	recipe = {
		{"", "mobs_creatures:poop_turd", ""},
		{"mobs_creatures:poop_turd", "mobs_creatures:poop_turd", "mobs_creatures:poop_turd"}
	}
})


code:
-- Pork drops for pig.

-- Register Raw Pork
minetest.register_craftitem("mobs_creatures:pork_raw", {
        description = "Raw Pork",
        inventory_image = "mobs_creatures_items_pork_raw.png",
        on_use = minetest.item_eat(4),
        groups = {food_meat_raw = 1, food_pork_raw = 1, flammable = 2},
})

-- Regiser Cooked Pork
minetest.register_craftitem("mobs_creatures:pork_cooked", {
        description = "Cooked Pork",
        inventory_image = "mobs_creatures_items_pork_cooked.png",
        on_use = minetest.item_eat(8),
        groups = {food_meat = 1, food_pork = 1, flammable = 2},
})

-- Regiser cooking recipe for raw pork --> cooked pork.
minetest.register_craft({
        type = "cooking",
        output = "mobs_creatures:pork_cooked",
        recipe = "mobs_creatures:pork_raw",
        cooktime = 5,
})


code:
-- raw rabbit
minetest.register_craftitem("mobs_creatures:rabbit_raw", {
        description = "Raw Rabbit",
        inventory_image = "mobs_creatures_items_rabbit_raw.png",
        on_use = minetest.item_eat(3),
        groups = {food_meat_raw = 1, food_rabbit_raw = 1, flammable = 2},
})

-- cooked rabbit
minetest.register_craftitem("mobs_creatures:rabbit_cooked", {
        description = "Cooked Rabbit",
        inventory_image = "mobs_creatures_items_rabbit_cooked.png",
        on_use = minetest.item_eat(5),
        groups = {food_meat = 1, food_rabbit = 1, flammable = 2},
})

minetest.register_craft({
        type = "cooking",
        output = "mobs_creatures:rabbit_cooked",
        recipe = "mobs_creatures:rabbit_raw",
        cooktime = 5,
})
-- rabbit hide
minetest.register_craftitem("mobs_creatures:rabbit_hide", {
        description = "Rabbit Hide",
        inventory_image = "mobs_creatures_items_rabbit_hide.png",
        groups = {flammable = 2},
})

minetest.register_craft({
        type = "fuel",
        recipe = "mobs_creatures:rabbit_hide",
        burntime = 2,
})

minetest.register_craft({
        output = "mobs_creatures:leather",
        type = "shapeless",
        recipe = {
                "mobs_creatures:rabbit_hide", "mobs_creatures:rabbit_hide",
                "mobs_creatures:rabbit_hide", "mobs_creatures:rabbit_hide"
        }
})


code:
-- Rotten flesh texture from mc_mobs.

-- If "hbhunger" mod is present, rotten flesh is made poisonous.
if minetest.get_modpath("hbhunger") ~= nil then
--        hbhunger.register_food("mobs_creatures:rotten_flesh", 1, "", 20) -- causing a weird issue with hbhunger "nil value" server fatal.
end

-- Register rotten flesh.
minetest.register_craftitem("mobs_creatures:rotten_flesh", {
        description = "Rotten Flesh",
        inventory_image = "mobs_creatures_items_rotten_flesh.png",
        on_use = minetest.item_eat(1),
})


code:
-- Items and drops for the Salmon fish.

-- Register Raw Salmon.
minetest.register_craftitem("mobs_creatures:salmon_raw", {
        description = "Raw Salmon",
        inventory_image = "mobs_creatures_items_salmon_raw.png",
        on_use = minetest.item_eat(2),
        groups = {food_fish_raw = 1, flammable = 2},
})

-- Regiser Cooked Salmon.
minetest.register_craftitem("mobs_creatures:salmon_cooked", {
        description = "Cooked Salmon",
        inventory_image = "mobs_creatures_items_salmon_cooked.png",
        on_use = minetest.item_eat(6),
        groups = {food_fish = 1, flammable = 2},
})

-- Regiser cooking recipe for raw Salmon to cooked Salmon.
minetest.register_craft({
        type = "cooking",
        output = "mobs_creatures:salmon_cooked",
        recipe = "mobs_creatures:salmon_raw",
        cooktime = 10,
})


code:
-- Items and drops for the Snapper fish.

-- Register Raw Snapper.
minetest.register_craftitem("mobs_creatures:snapper_raw", {
        description = "Raw Snapper",
        inventory_image = "mobs_creatures_items_snapper_raw.png",
        on_use = minetest.item_eat(2),
        groups = {food_fish_raw = 1, flammable = 2},
})

-- Regiser Cooked snapper.
minetest.register_craftitem("mobs_creatures:snapper_cooked", {
        description = "Cooked Snapper",
        inventory_image = "mobs_creatures_items_snapper_cooked.png",
        on_use = minetest.item_eat(6),
        groups = {food_fish = 1, flammable = 2},
})

-- Regiser cooking recipe for raw Snapper to cooked Snapper.
minetest.register_craft({
        type = "cooking",
        output = "mobs_creatures:snapper_cooked",
        recipe = "mobs_creatures:snapper_raw",
        cooktime = 10,
})


code:
-- todo: uses for silk.

-- Spiderweb item.
minetest.register_node("mobs_creatures:spiderweb", {
	description = "Spiderweb",
	drawtype = "plantlike",
	visual_scale = 1.2,
	tiles = {"mobs_creatures_items_spiderweb.png"},
	inventory_image = "mobs_creatures_items_spiderweb.png",
	paramtype = "light",
	liquid_viscosity = 20,
	liquidtype = "source",
	liquid_alternative_flowing = "mobs:spiderweb",
	liquid_alternative_source = "mobs:spiderweb",
	liquid_renewable = false,
	liquid_range = 0,
	walkable = false,
	pointable = true,
	diggable = true,
	buildable_to = false,
	drop = "mobs_creatures:spiderweb",
	groups = {snappy = 1, disable_jump = 1},
	sounds = default.node_sound_leaves_defaults(),
})

-- Spider Silk item.
minetest.register_craftitem("mobs_creatures:silk", {
	description = "Silk",
	inventory_image = "mobs_creatures_items_spider_silk.png",
	groups = {flammable = 2},
})

-- Make silk from spiderweb.
 minetest.register_craft({
	output = "mobs_creatures:silk",
	recipe = {
		{"mobs_creatures:spiderweb", "mobs_creatures:spiderweb", "mobs_creatures:spiderweb"},
		{"mobs_creatures:spiderweb", "default:stick", "mobs_creatures:spiderweb"},
		{"mobs_creatures:spiderweb", "mobs_creatures:spiderweb", "mobs_creatures:spiderweb"},
	}
})
-- Furnace Recipe for Spiderweb.
minetest.register_craft({
        type = "fuel",
        recipe = "mob_creatures:spiderweb",
        burntime = 1,
})

-- Furnace Recipe for Silk
minetest.register_craft({
	type = "fuel",
	recipe = "mob_creatures:silk",
	burntime = 1,
})


code:
--ASTRONAUT
-- TODO, DROPS, SOUNDS, ATTRIBUTIONS, trader
mobs:register_mob('mobs_creatures:astronaut', {
	type = "npc",
	attack_type = "dogfight",
	passive = false,
	attacks_monsters = true,
	attack_animals = false,
	attack_npcs = false,
	reach = 2,
	damage = 7,
	hp_min = 15,
	hp_max = 20,
	armor = 115,
	knock_back = false,
        collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
        visual = "mesh",
        mesh = "mobs_character.b3d",
        textures = {
                {"mobs_creatures_astronaut.png"},
        },
	blood_texture = "mobs_blood.png",
	makes_footstep_sound = true,
	sounds = {
		random ="mobs_creatures_astronaut_random",
--		warcry = "mobs_creatures_zombie_warcry",
--		attack = "mobs_creatures_zombie_attack",
--		damage = "mobs_creatures_zombie_damage",
--		death = "mobs_creatures_zombie_death",
	},
	walk_velocity = 1,
	run_velocity = 3,
	jump = true,
	floats = true,
	suffocation = false,
	view_range = 16,
	drops = {
--	{name = "mobs_creatures:rotten_flesh", chance = 5, min = 0, max = 1}
	},
	lava_damage = 5,
	water_damage = 2,
	light_damage = 0,
	fall_damage = 2,
        animation = {
                speed_normal = 30,
                speed_run = 30,
                stand_start = 0,
                stand_end = 79,
                walk_start = 168,
                walk_end = 187,
                run_start = 168,
                run_end = 187,
                punch_start = 200,
                punch_end = 219,
        },
        on_rightclick = function(self, clicker)
                mobs_trader(self, clicker, entity, mobs.lunar_human)
	end,

})

--Spawn Functions
mobs:spawn_specific("mobs_creatures:astronaut", {"default:gravel"}, {"vacuum:vacuum"}, 7, 16, 600, 1000, 1, 3000 ,3500)

--Spawn Eggs
mobs:register_egg("mobs_creatures:astronaut", "Astronaut Spawn Egg", "wool_white.png", 1)

-------- CREDITS & ATTRIBUTIONS --------
-- Trader concept by FreeGamers.org
-- Texture by iMorph
-- Sounds by craigsmith - https://freesound.org/people/craigsmith/sounds/438900/


code:
--License for code WTFPL and otherwise stated in license.
mobs:register_mob("mobs_creatures:bat", {
	type = "animal",
	passive = false,
	hp_min = 6,
	hp_max = 6,
	damage = 2,
	armor = 200,
	collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
	visual = "mesh",
	mesh = "mobs_creatures_bat.b3d",
	textures = {
		{"mobs_creatures_bat.png"},
	},
	visual_size = {x=1, y=1},
	sounds = {
		random = "mobs_creatures_bat_random",
		attack = "mobs_creatures_bat_attack",
		damage = "mobs_creatures_bat_damage",
		death = "mobs_creatures_bat_death",
		jump = "mobs_creatures_bat_jump",
		attack = "mobs_creatures_bat_attack",
		distance = 16,
	},
	walk_velocity = 4.5,
	run_velocity = 6.0,
	stand_chance = 10,
	-- TODO: Hang upside down
	animation = {
		walk_speed = 80, stand_speed = 80, run_speed = 80,
		stand_start = 0,		stand_end = 40,
		walk_start = 0,		walk_end = 40,
		run_start = 0,		run_end = 40,
	},

	water_damage = 1,
	lava_damage = 4,
	light_damage = 0,
	fall_damage = 0,
	view_range = 16,
	fly = true,
	fly_in = "air",
        do_custom = function(self, dtime)
                self.egg_timer = (self.egg_timer or 0) + dtime
                if self.egg_timer < 10 then
                       return
                end
                self.egg_timer = 0

                if self.child
                or math.random(1, 100) > 1 then
                        return
                end

                local pos = self.object:get_pos()

                minetest.add_item(pos, "mobs_creatures:poop_turd")

                minetest.sound_play("mobs_creatures_common_poop", {
                        pos = pos,
                        gain = 1.0,
                        max_hear_distance = 8,
                })
        end,
})

-- Spawning

--[[ If the game has been launched between the 20th of October and the 3rd of November system time,
-- the spawn rate is increased. ]]
local date = os.date("*t")
if (date.month == 10 and date.day >= 20) or (date.month == 11 and date.day <= 3) then
	-- Spawn on solid blocks at or below Sea level and the selected light level
	mobs:spawn_specific("mobs_creatures:bat", {"group:stone", "group:leaves"}, {"air"}, 0, 7, 60, 5000, 8, -11000, 230)
else
	-- Spawn on solid blocks at or below Sea level and the selected light level
	mobs:spawn_specific("mobs_creatures:bat", {"group:stone", "group:leaves"}, {"air"}, 0, 5, 60, 10000, 2, -11000, 230)
end

-- spawn eggs
mobs:register_egg("mobs_creatures:bat", "Bat", "wool_black.png", 1)


code:
-- Blood Golem by FreeGamers.org
-- A weak creature made of cursed blood that spills upon death. Inspired by Dwarf Fortress's Blood Man.

-- Register mob with Mobs API
mobs:register_mob("mobs_creatures:blood_man", {
	type = "monster",
	passive = false,
	attack_type = "dogfight",
	reach = 2,
	damage = 4,
	hp_min = 10,
	hp_max = 10,
	armor = 200,
	collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
	visual = "mesh",
        mesh = "mobs_character.b3d",
	textures = {
		{"mobs_creatures_blood_man.png"},
	},
	blood_texture = "mobs_blood.png",
	makes_footstep_sound = true,
	sounds = {
		random = "mobs_creatures_dirt_golem_random",
		damage = "default_snow_footstep",
		jump = "default_snow_footstep",
		death = "default_water_footstep",
	},
	view_range = 12,
	walk_velocity = 1,
	run_velocity = 3,
	jump = true,
	knock_back = false,
	water_damage = 0,
	lava_damage = 0,
	light_damage = 0,
	fall_damage = 0,
	fear_height = 4,
        animation = {
                speed_normal = 30,
                speed_run = 30,
                stand_start = 0,
                stand_end = 79,
                walk_start = 168,
                walk_end = 187,
                run_start = 168,
                run_end = 187,
                punch_start = 200,
                punch_end = 219,
        },
    on_die = function(self, pos) -- on die, spawn a blood source.
	if minetest.get_node(pos).name == "air" then
		minetest.set_node(pos, {name = "mobs_creatures:blood_source"})
	end
        self.object:remove()
    end,
})

-- Register Spawn Parameters
mobs:spawn_specific("mobs_creatures:blood_man", {"group:cracky", "group:crumbly", "group:shovely", "group:pickaxey"}, {"air"}, 0, 7, 60, 75000, 1, -9500, -6500)

-- Register Spawn Egg
mobs:register_egg("mobs_creatures:blood_man", "Blood Man Spawn Egg", "mobs_creatures_items_blood_source.png", 1)


code:
-- BOGEYMAN by freegamers.org
-- Insult clips edited from "Iceofdoom" https://freesound.org/people/Iceofdoom/sounds/396900/
-- Laughs from "cacti225" https://freesound.org/people/cacti225/sounds/405613/
-- Snarl sounds from "Desyncho" https://freesound.org/people/Darsycho/sounds/443404/
mobs:register_mob("mobs_creatures:bogeyman", {
   type = "monster",
   passive = false,
   damage = 9,
   reach = 2,
   attack_type = "dogfight",
   hp_min = 10,
   hp_max = 20,
   armor = 75,
   knock_back = false,
   collisionbox = {-0.25,-0.5,-0.25, 0.25,0.4,0.25},
   visual = "mesh",
   mesh = "mobs_character.b3d",
   textures = {
      {"mobs_creatures_bogeyman.png"},
   },
   blood_amount = 4,
   blood_texture = "mobs_creatures_common_shadow.png",
   visual_size = {x=0.5, y=0.5},
   makes_footstep_sound = false,
   walk_velocity = 2,
   run_velocity = 3.25,
   floats = 1,
   jump = true,
   sounds = {
                distance = "16",
		war_cry = "mobs_creatures_bogeyman_warcry",
                random = "mobs_creatures_bogeyman_random",
                attack = "mobs_creatures_bogeyman_attack",
                damage = "mobs_creatures_bogeyman_damage",
                death = "mobs_creatures_bogeyman_death",
   },
   water_damage = 0,
   lava_damage = 0,
   light_damage = 20,
   view_range = 12,
   animation = {
          speed_normal = 30,
          speed_run = 30,
          stand_start = 0,
          stand_end = 79,
          walk_start = 168,
          walk_end = 187,
          run_start = 168,
          run_end = 187,
--          punch_start = 200,
--          punch_end = 219,
        },
--particle spawner
   do_custom = function(self)
   		local apos = self.object:getpos()
		minetest.add_particlespawner({
                        1, --amount
                        0.3, --time
                        {x=apos.x-0.3, y=apos.y+0.0, z=apos.z-0.3}, --minpos
                        {x=apos.x+0.3, y=apos.y+0.0, z=apos.z+0.3}, --maxpos
                        {x=-0, y=-0, z=-0}, --minvel
                        {x=0, y=0, z=0}, --maxvel
                        {x=0,y=1,z=0}, --minacc
                        {x=0.5,y=1.2,z=0.5}, --maxacc
                        3, --minexptime
                        5, --maxexptime
                        2, --minsize
                        3, --maxsize
                        true, --collisiondetection
                        "mobs_creatures_common_shadow.png" --texture
                	})
	end,
})

--Spawn Functions
--API Template: mobs:spawn_specfic(name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height, day_toggle, on_spawn)
mobs:spawn_specific("mobs_creatures:bogeyman", {"group:cracky", "group:crumbly", "group:shovely", "group:pickaxey"}, {"air"}, 0, 1, 480, 25000, 2, 0, 100, false)
mobs:register_egg("mobs_creatures:bogeyman", "Bogeyman Spawn Egg", "wool_black.png", 1)


code:
-- Skin by "misspinkbunny34"
--License for code WTFPL and otherwise stated in readmes
-- REGISTER MOB & ATTRIBUTES
mobs:register_mob("mobs_creatures:boomer", {
	type = "monster",
	hp_min = 20,
	hp_max = 20,
	collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
	pathfinding = 1,
	visual = "mesh",
	mesh = "mobs_character.b3d",
	textures = {
		{"mobs_creatures_boomer.png"},
	},
	sounds = {
		attack = "tnt_ignite",
		death = "mobs_creatures_boomer_death",
		damage = "mobs_creatures_boomer_damage",
		fuse = "tnt_ignite",
		explode = "tnt_explode",
		distance = 16,
	},
	makes_footstep_sound = true,
	walk_velocity = 1.05,
	run_velocity = 2.5,
	runaway_from = { "mobs_mc:ocelot", "mobs_mc:cat" },
	attack_type = "explode",
	damage = 30,
	explosion_radius = 3,
	reach = 2,
	explosion_damage_radius = 7,
	explosion_timer = 1.5,
	allow_fuse_reset = true,
	stop_to_explode = true,
	-- Force-ignite creeper with flint and steel and explode after 1.5 seconds.
	-- TODO: Make creeper flash after doing this as well.
	-- TODO: Test and debug this code.
	on_rightclick = function(self, clicker)
		if self._forced_explosion_countdown_timer ~= nil then
			return
		end
		local item = clicker:get_wielded_item()
		if item:get_name() == "fire:flint_and_steel" then
			if not minetest.settings:get_bool("creative_mode") then
				-- Wear tool
				local wdef = item:get_definition()
				item:add_wear(1000)
				-- Tool break sound
				if item:get_count() == 0 and wdef.sound and wdef.sound.breaks then
					minetest.sound_play(wdef.sound.breaks, {pos = clicker:getpos(), gain = 0.5})
				end
				clicker:set_wielded_item(item)
			end
			self._forced_explosion_countdown_timer = self.explosion_timer
			minetest.sound_play(self.sounds.attack, {pos = self.object:getpos(), gain = 1, max_hear_distance = 16})
		end
	end,
	do_custom = function(self, dtime)
		if self._forced_explosion_countdown_timer ~= nil then
			self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime
			if self._forced_explosion_countdown_timer <= 0 then
				mobs:explosion(self.object:getpos(), self.explosion_radius, 0, 1, self.sounds.explode)
				self.object:remove()
			end
		end
	end,
	maxdrops = 2,
	drops = {
		{name = "tnt:gunpowder", chance = 1, min = 1, max = 4,},
                {name = "tnt:tnt_stick", chance = 25, min = 1, max = 2,},
                {name = "tnt:tnt", chance = 100, min = 1, max = 1,},
	},
        animation = {
                speed_normal = 30,
                speed_run = 30,
                stand_start = 0,
                stand_end = 79,
                walk_start = 168,
                walk_end = 187,
                run_start = 168,
                run_end = 187,
                punch_start = 0,
                punch_end = 79,
        },
	floats = 1,
	fear_height = 4,
	water_damage = 1,
	lava_damage = 4,
	light_damage = 0,
	view_range = 16,
	blood_amount = 0,
    on_die = function(self, pos) -- on die, spawn particles.
        minetest.add_particlespawner({
            amount = 100,
            time = 0.1,
            minpos = {x=pos.x-1, y=pos.y-1, z=pos.z-1},
            maxpos = {x=pos.x+1, y=pos.y+1, z=pos.z+1},
            minvel = {x=-0, y=-0, z=-0},
            maxvel = {x=1, y=1, z=1},
            minacc = {x=-0.5,y=5,z=-0.5},
            maxacc = {x=0.5,y=5,z=0.5},
            minexptime = 0.1,
            maxexptime = 1,
            minsize = 2,
            maxsize = 4,
            collisiondetection = false,
	    texture="tnt_smoke.png"
        })
        self.object:remove()
    end,
})

-- Spawns on Solid blocks
mobs:spawn_specific("mobs_creatures:boomer", {"group:cracky", "group:crumbly", "group:shovely", "group:pickaxey"}, {"air"}, 0, 6, 60, 10000, 2, -26000, 150, false)

-- spawn eggs
mobs:register_egg("mobs_creatures:boomer", "Boomer Spawn Egg", "tnt_bottom.png", 1)


code:
-- CACODEMON BY DOOM3D
-- EDITED BY FREEGAMERS.ORG

-- REGISTER CACODEMON
mobs:register_mob("mobs_creatures:cacodemon", {
   type = "monster",
   passive = false,
   attacks_monsters = true,
   damage = 10,
   reach = 3,
   attack_type = "shoot",
   shoot_interval = 2,
   arrow = "mobs_creatures:a_cacodemon_plasma_ball",
   shoot_offset = 1,
   hp_min = 50,
   hp_max = 50,
   armor = 100,
   collisionbox = {-0.9, -0.2, -0.9, 0.9, 1.5, 0.9},
   visual = "mesh",
   mesh = "mobs_creatures_cacodemon.b3d",
   textures = {
      {"mobs_creatures_cacodemon.png"},
   },
   visual_size = {x=2, y=2},
   makes_footstep_sound = false,
   walk_velocity = 3,
   run_velocity = 5,
        sounds = {
                distance = "20",
                random = "mobs_creatures_cacodemon_random",
                war_cry = "mobs_creatures_cacodemon_warcry",
                shoot_attack = "mobs_creatures_common_shoot_plasmaball",
                damage = "mobs_creatures_pinky_damage",
                death = "mobs_creatures_cacodemon_death",
        },
   jump = true,
   fly = true,
   fall_speed = 0,
   stepheight = 10,
   water_damage = 2,
   lava_damage = 0,
   light_damage = 0,
   view_range = 20,
   animation = {
      speed_normal = 10,
      speed_run = 20,
      walk_start = 1,
      walk_end = 20,
      stand_start = 1,
      stand_end = 20,
      run_start = 1,
      run_end = 20,
      shoot_start = 20,
      shoot_end = 40,
   },
})
-- REGISTER ARROW: CACODEMON PLASMA BALL
mobs:register_arrow("mobs_creatures:a_cacodemon_plasma_ball", {
   visual = "sprite",
   visual_size = {x = 1, y = 1},
   textures = {"mobs_creatures_arrow_plasmaball.png"},
   velocity = 12,
   glow = 5,
   tail = 1, -- enable tail
   tail_texture = "mobs_creatures_arrow_plasmaball_trail.png",

   hit_player = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 25},
      }, nil)
       minetest.sound_play({name = "mobs_creatures_common_shoot_plasmaball_hit", gain = 1.0}, {pos=player:getpos(), max_hear_distance = 12})
   end,

   hit_mob = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 25},
      }, nil)
   end,

   hit_node = function(self, pos, node)
       minetest.sound_play({name = "mobs_creatures_common_shoot_plasmaball_hit", gain = 1.0}, {pos=pos, max_hear_distance = 12})
      self.object:remove()
   end,
})

--mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height, day_toggle)
mobs:spawn_specific("mobs_creatures:cacodemon", {"nether:sand","nether:glowstone","default:lava_source", "default:lava_flowing"}, {"air"}, 0, 16, 60, 10000, 6, -30912, -16000)

mobs:register_egg("mobs_creatures:cacodemon", "Cacodemon", "wool_red.png", 1)


code:
-- CAVE CROCODILE BY FREEGAMERS.ORG
-- INSPIRED BY DWARF FORTRESS
-- MODEL AND TEXTURE BASED ON PALEOTEST BY ELCEEJO

-- Land and Water animation sets
local animation_water = {
		speed_normal = 10,
		speed_sprint = 20,
		stand_start = 150,
		stand_end = 170,
		walk_start = 150,
		walk_end = 170,
		punch_start = 130,
		punch_end = 145,
		punch_loop = false,
		}
local animation_land = {
		speed_normal = 10,
		speed_sprint = 20,
		stand_start = 50,
		stand_end = 120,
		walk_start = 1,
		walk_end = 40,
		punch_start = 130,
		punch_end = 145,
		punch_loop = false,
		}

-- REGISTER CAVE CROCODILE
mobs:register_mob("mobs_creatures:cave_crocodile", {
	type = "monster",
	hp_min = 50,
	hp_max = 50,
	armor = 100,
	passive = false,
	walk_velocity = 1.0,
	run_velocity = 2.75,
        walk_chance = 5,
        jump = false,
        jump_height = 1.1,
        stepheight = 1.1,
        fly = true,
        fly_in = "default:water_source",
        runaway = false,
        pushable = false,
        view_range = 4,
        knock_back = false,
        damage = 15,
	fear_height = 6,
	fall_speed = -1,
	fall_damage = 10,
	water_damage = 0,
	lava_damage = 5,
	light_damage = 0,
        suffocation = false,
        floats = 0,
	owner = "",
	order = "follow",
	follow = {"mobs:meat_raw"},
        reach = 3,
        attack_chance = 30,
        attack_animals = true,
        attack_npcs = true,
        attack_players = true,
        owner_loyal = true,
        group_attack = false,
	attack_type = "dogfight",
	pathfinding = 0,
	makes_footstep_sound = true,
	sounds = {
		attack = "mobs_creatures_crocodile_attack",
		damage = "mobs_creatures_crocodile_damage",
		death = "mobs_creatures_crocodile_death",
		jump = "mobs_creatures_crocodile_jump",
	},
	drops = {
		{name = "mobs:meat_raw", chance = 1, min = 1, max = 10},
		{name = "mobs:leather",	chance = 1, min = 1, max = 10},
	},
	visual = "mesh",
	visual_size = {x=9, y=9},
	collisionbox = {-1, -0.6, -0.8, 1, 0.7, 0.8},
	textures = {
		{"mobs_creatures_cave_crocodile.png"},
	},
	child_texture = {
		{"mobs_creatures_cave_crocodile.png"},
	},
	mesh = "mobs_creatures_crocodile.b3d",
	animation = {
		speed_normal = 10,
		speed_sprint = 20,
		stand_start = 50,
		stand_end = 120,
		walk_start = 1,
		walk_end = 40,
		punch_start = 130,
		punch_end = 145,
		punch_loop = false,
	},

	on_rightclick = function(self, clicker)

		-- feed or tame
		if mobs:feed_tame(self, clicker, 8, true, true) then return end
		if mobs:protect(self, clicker) then return end

		if self.owner == "" then
			self.owner = clicker:get_player_name()
		else
			if self.order == "follow" then
				self.order = "stand"
			else
				self.order = "follow"

			end

		end

	end,

	do_custom = function(self, dtime, nodef)

-- Mob changes animation and can swim in water

	local nodef = minetest.registered_nodes[self.standing_in]

        if nodef.groups.water then

        self.fly = true
        self.fly_in = "default:water_source"
        self.floats = 0
        self.view_range = 12
        self.walk_chance = 100
        self.animation = animation_water
	elseif not self:attempt_flight_correction() then

        self.fly = false
        self.floats = 0
        self.view_range = 8
        self.walk_chance = 10
        self.animation = animation_land
            return
	end

-- Behaviour for young mobs

	if self.child == true then
		self.type = "animal"
		self.passive = true
	        self.attack_animals = false
		self.walk_velocity = 0.3
		self.run_velocity = 0.3
		return
	end
	-- Can Lay Eggs
                self.egg_timer = (self.egg_timer or 0) + dtime
                if self.egg_timer < 5 then
                       return
                end
                self.egg_timer = 0

                if self.child
                or math.random(1, 100) > 1 then
                        return
                end

                local pos = self.object:get_pos()

                minetest.add_entity(pos, "mobs_creatures:cave_crocodile_egg")
                minetest.sound_play("mobs_creatures_chicken_eggpop.ogg", {
                        pos = pos,
                        gain = 1.0,
                        max_hear_distance = 8,
                })
        end,
})

mobs:spawn_specific("mobs_creatures:cave_crocodile", {"default:water_source", "default:water_flowing", "default:river_water_source", "default:river_water_flowing", "group:stone"}, {"default:water_source", "default:water_flowing", "default:river_water_source", "default:river_water_flowing"}, 0, 7, 240, 2500, 2, -6500,-500)
mobs:register_egg("mobs_creatures:cave_crocodile", "Cave Crocodile Spawn Egg", "default_silver_sand.png", 1)

-- Cave Crocodile Egg
mobs:register_mob("mobs_creatures:cave_crocodile_egg", {
	type = "nil",
	hp_min = 5,
	hp_max = 5,
	armor = 200,
	passive = true,
	walk_velocity = 0,
	run_velocity = 0,
	jump = false,
	runaway = false,
        pushable = true,
	fear_height = 5,
	fall_damage = 0,
	fall_speed = -8,
	water_damage = 1,
	lava_damage = 5,
	light_damage = 0,
	collisionbox = {-0.2, -0.5, -0.2, 0.2, 0, 0.2},
	visual = "mesh",
	mesh = "mobs_creatures_egg.b3d",
	textures = {
		{"mobs_creatures_egg_3.png"},
	},
	makes_footstep_sound = false,
	animation = {
		speed_normal = 1,
		stand_start = 1,
		stand_end = 1,
		walk_start = 1,
		walk_end = 1,
	},

	do_custom = function(self, dtime)

		self.egg_timer = (self.egg_timer or 0) + dtime
		if self.egg_timer < 10 then
			return
		end
		self.egg_timer = 0

		if self.child
		or math.random(1, 100) > 1 then
			return
		end

		local pos = self.object:get_pos()

		mob = minetest.add_entity(pos, "mobs_creatures:cave_crocodile")
                ent2 = mob:get_luaentity()
		self.object:remove()

		mob:set_properties({
			textures = ent2.child_texture[1],
			visual_size = {
				x = ent2.base_size.x / 2,
				y = ent2.base_size.y / 2
			},
			collisionbox = {
				ent2.base_colbox[1] / 2,
				ent2.base_colbox[2] / 2,
				ent2.base_colbox[3] / 2,
				ent2.base_colbox[4] / 2,
				ent2.base_colbox[5] / 2,
				ent2.base_colbox[6] / 2
			},
		})

		ent2.child = true
		ent2.tamed = false
	end
})

mobs:register_egg("mobs_creatures:cave_crocodile_egg", "Cave Crocodile Egg", "mobs_creatures_egg_3_inv.png", 0)


code:
-- BY FREEGAMERS.ORG
-- CAVE FLOATER,INSPIRED BY DF
-- ASSETS FROM D00MED'S HORROR PACK MOGALL
-- (TODO: MAKE POSIONOUS GAS) Reference NSSM:venomous_gas and df_caverbs mine_gas:gas, drops leather

mobs:register_mob("mobs_creatures:cave_floater", {
   type = "animal",
   passive = false,
   damage = 0, -- simulate push attack
   reach = 2,
   attack_type = "dogshoot",
   arrow = "mobs_creatures:a_cave_floater_gasball",
   shoot_interval = 2.5,
   dogshoot_switch = 2,
   dogshoot_count = 0,
   dogshoot_count_max =2,
   hp_min = 20,
   hp_max = 20,
   armor = 150,
   knock_back = true,
   collisionbox = {-0.6, -0.25, -0.6, 0.6, 0.9, 0.6},
   visual = "mesh",
   mesh = "mobs_creatures_cave_floater.b3d",
   textures = {
      {"mobs_creatures_cave_floater.png"},
   },
   visual_size = {x=3, y=3},
   makes_footstep_sound = false,
   walk_velocity = 1,
   run_velocity = 2,
   jump = true,
   fly = true,
   floats = true,
   fall_speed = 0,
   stepheight = 1,
   water_damage = 0,
   lava_damage = 10,
   light_damage = 0,
   view_range = 32,
   sounds = {
        death = "mobs_creatures_demon_eye_death",
        damage = "mobs_creatures_demon_eye_damage",
        attack = "mobs_creatures_demon_eye_attack",
	shoot_attack = "mobs_creatures_common_shoot_poisonball",
	},
   animation = {
      speed_normal = 5,
      speed_run = 6,
      walk_start = 20,
      walk_end = 60,
      stand_start = 1,
      stand_end = 20,
      run_start = 20,
      run_end = 60,
      punch_start = 20,
      punch_end = 60,
   },
   on_die = function(self,pos)
	      minetest.set_node(pos, {name = "mine_gas:gas"})
            end
})
-- REGISTER ARROW: Gas Attack
mobs:register_arrow("mobs_creatures:a_cave_floater_gasball", {
   visual = "sprite",
   visual_size = {x = 1, y = 1},
   textures = {"mobs_creatures_arrow_poisonball.png"},
   velocity = 6,
   glow = 5,
   tail = 1, -- enable tail
   tail_texture = "mobs_creatures_arrow_poisonball_trail.png",

   hit_player = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 10},
      }, nil)
       minetest.sound_play({name = "mobs_creatures_common_shoot_poisonball_hit", gain = 1.0}, {pos=player:getpos(), max_hear_distance = 12})
       minetest.set_node(player:getpos(), {name = "mine_gas:gas"})
   end,

   hit_mob = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 10},
      }, nil)
   end,

   hit_node = function(self, pos, node)
       minetest.sound_play({name = "mobs_creatures_common_shoot_poisonball_hit", gain = 1.0}, {pos=pos, max_hear_distance = 12})
      minetest.set_node(pos, {name = "mine_gas:gas"})
      self.object:remove()
   end,
})
-- REGISTER SPAWN PARAMETERS: spawns on top of air by glow worms, flowstones, stalagtite.
mobs:spawn_specific("mobs_creatures:cave_floater", {"df_mapitems:glow_worm", "df_mapitems:wet_stal_1","df_mapitems:wet_stal_2", "df_mapitems:wet_stal_3","df_mapitems:wet_stal_4"},{"air"},  0, 10, 60, 2500, 8, -9500, -3500)

-- REGISTER SPAWN EGG
mobs:register_egg("mobs_creatures:cave_floater", "Cave Floater Spawn Egg", "default_obsidian.png", 1)


code:
--License for code WTFPL and otherwise stated in readmes
mobs:register_mob("mobs_creatures:chicken", {
        type = "animal",
        hp_min = 4,
        hp_max = 4,
        collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.69, 0.2},
        runaway = true,
        jump = false,
        floats = 1,
        visual = "mesh",
        mesh = "mobs_creatures_chicken.b3d",
        textures = {
                {"mobs_creatures_chicken.png"},
        },
        visual_size = {x=2.2, y=2.2},

        makes_footstep_sound = true,
        walk_velocity = 1,
        drops = {
                {name = "mobs_creatures:chicken_raw", chance = 2, min = 1, max = 1},
                {name = "mobs_creatures:chicken_feather", chance = 2, min = 0, max = 1},
        },

        water_damage = 1,
        lava_damage = 4,
        light_damage = 0,
        fall_damage = 0,
        fall_speed = -2.25,
        sounds = {
                random = "mobs_creatures_chicken_random",
                death = "mobs_creatures_chicken_damage",
                damage = "mobs_creatures_chicken_damage",
                distance = 16,
        },
        animation = {
                stand_speed = 25, walk_speed = 25, run_speed = 50,
                stand_start = 0,                stand_end = 0,
                walk_start = 0,         walk_end = 40,
                run_start = 0,          run_end = 40,
        },

        follow = {"farming:seed_wheat", "farming:seed_cotton"},
        view_range = 16,
        fear_height = 2,

        on_rightclick = function(self, clicker)
                if mobs:feed_tame(self, clicker, 1, true, true) then return end
                if mobs:protect(self, clicker) then return end
                if mobs:capture_mob(self, clicker, 0, 60, 5, false, nil) then return end
        end,

        do_custom = function(self, dtime)

                self.egg_timer = (self.egg_timer or 0) + dtime
                if self.egg_timer < 10 then
                        return
                end
                self.egg_timer = 0

                if self.child
                or math.random(1, 100) > 1 then
                        return
                end

                local pos = self.object:getpos()

                minetest.add_item(pos, "mobs_creatures:egg")

                minetest.sound_play("mobs_creatures_chicken_eggpop", {
                        pos = pos,
                        gain = 1.0,
                        max_hear_distance = 16,
                })
        end,

})

--spawn
mobs:spawn_specific("mobs_creatures:chicken", {"default:dirt_with_grass","ethereal:prairie_dirt"}, {"air"}, 9, 15, 120, 2500, 3, 2, 30, true)

-- spawn eggs
mobs:register_egg("mobs_creatures:chicken", "Chicken Spawn Egg", "wool_red.png", 1)


code:
--###################
--################### Clownfish
--###################
-- TODO: color textures, drops.
mobs:register_mob("mobs_creatures:clownfish", {
	type = "animal",
	passive = true,
	runaway = true,
        runaway_from = {"player"},
	stepheight = 0.1,
	hp_min = 3,
	hp_max = 3,
	armor = 200,
	collisionbox = {-0.25, -0.2, -0.25, 0.25, 0.2, 0.25},
	visual = "mesh",
	visual_size = {x = 2, y = 2, z= 2},
	mesh = "mobs_creatures_clownfish.b3d",
    	textures = {
        { "mobs_creatures_clownfish_1.png"},
	{ "mobs_creatures_clownfish_2.png"},
        { "mobs_creatures_clownfish_3.png"},
        { "mobs_creatures_clownfish_4.png"},
        { "mobs_creatures_clownfish_5.png"},
        { "mobs_creatures_clownfish_6.png"},
        { "mobs_creatures_clownfish_7.png"},
        { "mobs_creatures_clownfish_8.png"},
        { "mobs_creatures_clownfish_9.png"},
        { "mobs_creatures_clownfish_10.png"},
        { "mobs_creatures_clownfish_11.png"},
        { "mobs_creatures_clownfish_12.png"},
        { "mobs_creatures_clownfish_13.png"},
	},
	visual_size = {x=3, y=3},
        drops = {
 	       {name = "mobs_creatures:clownfish_raw", chance = 1, min = 1, max = 1},
	       {name = "bonemeal:bonemeal", chance = 20, min = 1, max = 1},
        },
	walk_velocity = 0.6,
	run_velocity = 2.75,
	jump = false,
	fly = true,
	fly_in = "default:water_source",
	fall_speed = 0,
	view_range = 6,
	water_damage = 0,
	lava_damage = 10,
	light_damage = 0,
	animation = {
		stand_speed = 25,
		walk_speed = 25,
		run_speed = 50,
		speed_normal = 15,
		speed_run = 25,
		stand_start = 40,
		stand_end = 100,
		walk_start = 0,
		walk_end = 50,
		run_start = 0,
		run_end = 50,
	},
})
-- Register spawning conditions. -- spawns in tropical and warm, near coral.
mobs:spawn_specific("mobs_creatures:clownfish",      {"default:coral_brown", "default:coral_orange","default:coral_cyan","default:coral_green","default:coral_pink", "decorations_sea:coral_01", "decorations_sea:coral_02", "decorations_sea:coral_03", "decorations_sea:coral_04", "decorations_sea:coral_05", "decorations_sea:coral_06", "decorations_sea:coral_07", "decorations_sea:coral_08", "decorations_sea:coral_plantlike_01", "decorations_sea:coral_plantlike_02", "decorations_sea:coral_plantlike_03", "decorations_sea:coral_plantlike_04", "decorations_sea:coral_plantlike_05"},       {"default:water_flowing","default:water_source"}, 1, 16, 60, 125, 16, -200, -1)

-- Register spawn egg.
mobs:register_egg("mobs_creatures:clownfish", "Clownfish Spawn Egg", "default_water.png", 1)


code:
--################### COD
-- From mobs_mc

--cod swims from 0 to 20
--cod when its on land 30 to 50

mobs:register_mob("mobs_creatures:cod", {
	type = "animal",
	passive = true,
        runaway = true,
        runaway_from = {"player"},
        stepheight = 0.1,
	hp_min = 3,
	hp_max = 3,
	armor = 200,
        collisionbox = {-0.35, -0.01, -0.35, 0.35, 0.5, 0.35},
	visual = "mesh",
	mesh = "mobs_creatures_cod.b3d",
	textures = {
		{"mobs_creatures_cod.png"},
	},
	visual_size = {x=3, y=3},
        drops = {
               {name = "mobs_creatures:cod_raw", chance = 1, min = 1, max = 1},
               {name = "bonemeal:bonemeal", chance = 20, min = 1, max = 1},
        },
	walk_velocity = 0.6,
	run_velocity = 2.75,
	jump = false,
	makes_footstep_sound = false,
	fly = true,
	fly_in = "default:water_source",
	fall_speed = 0,
	view_range = 6,
	water_damage = 0,
	lava_damage = 3,
	light_damage = 0,
	animation = {
	        stand_speed = 25,
	        walk_speed = 25,
		die_speed = 25,
		run_speed = 50,
		stand_start = 0,
	        stand_end = 20,
		walk_start = 0,
	        walk_end = 20,
		run_start = 0,
	        run_end = 20,
		die_start = 30,
		die_end = 50,
	},
})
mobs:spawn_specific("mobs_creatures:cod",      {"default:sand_with_kelp", "default:ice", "default:snow", "default:wood", "default:tree","decorations_sea:seagrass_01", "decorations_sea:seagrass_03", "decorations_sea:seashell_01_node", "decorations_sea:seashell_02_node", "decorations_sea:seashell_03_node"},       {"default:water_flowing","default:water_source"}, 1, 20, 60, 100, 16, -200, -1)
mobs:register_egg("mobs_creatures:cod", "Cod Spawn Egg", "default_stone.png", 1)


code:
-- COW FROM MOBS_MC, SIMPLIFIED BY FREEGAMERS.ORG
mobs:register_mob("mobs_creatures:cow", {
	type = "animal",
	hp_min = 10,
	hp_max = 10,
	collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.39, 0.45},
	visual = "mesh",
	mesh = "mobs_creatures_cow.b3d",
	textures = { {
		"mobs_creatures_cow.png",
		"transparent_pixel.png",
	}, },
	visual_size = {x=2.8, y=2.8},
	makes_footstep_sound = true,
	walk_velocity = 1,
	drops = {
		{name = "mobs:meat_raw", chance = 1, min = 1, max = 3,},
		{name = "mobs:leather",chance = 1,min = 0,max = 2,},
	},
	water_damage = 1,
	lava_damage = 5,
	light_damage = 0,
	runaway = true,
	sounds = {
		random = "mobs_creatures_cow_random",
		death = "mobs_creatures_cow_damage",
		damage = "mobs_creatures_cow_damage",
		jump = "mobs_creatures_cow_jump",
		distance = 16,
	},
	animation = {
		stand_speed = 25, walk_speed = 25, run_speed = 50,
		stand_start = 0,		stand_end = 0,
		walk_start = 0,		walk_end = 40,
		run_start = 0,		run_end = 40,
	},
	follow = "farming:wheat",
        replace_rate = 10,
        replace_what = {
                {"group:grass", "air", 0},
                {"default:dirt_with_grass", "default:dirt", -1}
        },
        on_rightclick = function(self, clicker)

                -- feed or tame
                if mobs:feed_tame(self, clicker, 8, true, true) then

                        -- if fed 7x wheat or grass then cow can be milked again
                        if self.food and self.food > 6 then
                                self.gotten = false
                        end

                        return
                end

                if mobs:protect(self, clicker) then return end
                if mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) then return end

                local tool = clicker:get_wielded_item()
                local name = clicker:get_player_name()

                -- milk cow with empty bucket
                if tool:get_name() == "mesecraft_bucket:bucket_empty" then

                        --if self.gotten == true
                        if self.child == true then
                                return
                        end

                        if self.gotten == true then
                                minetest.chat_send_player(name,
                                        "Cow already milked!")
                                return
                        end

                        local inv = clicker:get_inventory()

                        tool:take_item()
                        clicker:set_wielded_item(tool)
		-- Add bucket of milk and play a sound effect
                        if inv:room_for_item("main", {name = "mobs_creatures:milk_bucket"}) then
		                local pos = self.object:getpos()
                                clicker:get_inventory():add_item("main", "mobs_creatures:milk_bucket")
                                minetest.sound_play("mobs_creatures_cow_milk", {
                                pos = pos,
                                gain = 1.0,
                                max_hear_distance = 8,
                                })
                        else
                                local pos = self.object:get_pos()
                                pos.y = pos.y + 0.5
                                minetest.add_item(pos, {name = "mobs_creatures:milk_bucket"})
		                minetest.sound_play("mobs_creatures_cow_milk", {
                	        pos = pos,
                        	gain = 1.0,
	                        max_hear_distance = 8,
        		        })

                        end

                        self.gotten = true -- milked
			return
		end
	end,
	follow = "farming:wheat",
	view_range = 10,
	fear_height = 2,
        on_replace = function(self, pos, oldnode, newnode)

                self.food = (self.food or 0) + 1

                -- if cow replaces 8x grass then it can be milked again
                if self.food >= 8 then
                        self.food = 0
                        self.gotten = false
                end
        end,
	-- Make the cow poop.
        do_custom = function(self, dtime)
                self.egg_timer = (self.egg_timer or 0) + dtime
                if self.egg_timer < 10 then
                       return
                end
                self.egg_timer = 0

                if self.child
                or math.random(1, 100) > 1 then
                        return
                end

                local pos = self.object:get_pos()

                minetest.add_item(pos, "mobs_creatures:poop_turd")

                minetest.sound_play("mobs_creatures_common_poop", {
                        pos = pos,
                        gain = 1.0,
                        max_hear_distance = 8,
                })
        end,

})
-- Register Cow Spawn Parameters
mobs:spawn_specific("mobs_creatures:cow", {"default:dirt", "default:dirt_with_grass", "ethereal:prairie_dirt", "ethereal:mushroom_dirt"}, {"air"}, 9, 15, 120, 5000, 4, 0, 200)

-- Register Cow Spawn Egg
mobs:register_egg("mobs_creatures:cow", "Cow Spawn Egg", "wool_brown.png", 1)


code:
-- CROCODILE BY FREEGAMERS.ORG
-- MODEL AND TEXTURE BASED ON PALEOTEST BY ELCEEJO

-- Land and Water animation sets
local animation_water = {
		speed_normal = 10,
		speed_sprint = 20,
		stand_start = 150,
		stand_end = 170,
		walk_start = 150,
		walk_end = 170,
		punch_start = 130,
		punch_end = 145,
		punch_loop = false,
		}
local animation_land = {
		speed_normal = 10,
		speed_sprint = 20,
		stand_start = 50,
		stand_end = 120,
		walk_start = 1,
		walk_end = 40,
		punch_start = 130,
		punch_end = 145,
		punch_loop = false,
		}

-- REGISTER CROCODILE
mobs:register_mob("mobs_creatures:crocodile", {
	type = "monster",
	hp_min = 50,
	hp_max = 50,
	armor = 100,
	passive = false,
	walk_velocity = 1.0,
	run_velocity = 2.75,
        walk_chance = 5,
        jump = false,
        jump_height = 1.1,
        stepheight = 1.1,
        fly = true,
        fly_in = "default:water_source",
        runaway = false,
        pushable = false,
        view_range = 4,
        knock_back = false,
        damage = 15,
	fear_height = 6,
	fall_speed = -1,
	fall_damage = 10,
	water_damage = 0,
	lava_damage = 5,
	light_damage = 0,
        suffocation = false,
        floats = 0,
	owner = "",
	order = "follow",
	follow = {"mobs:meat_raw"},
        reach = 3,
        attack_chance = 30,
        attack_animals = true,
        attack_npcs = true,
        attack_players = true,
        owner_loyal = true,
        group_attack = false,
	attack_type = "dogfight",
	pathfinding = 0,
	makes_footstep_sound = true,
	sounds = {
		attack = "mobs_creatures_crocodile_attack",
		damage = "mobs_creatures_crocodile_damage",
		death = "mobs_creatures_crocodile_death",
		jump = "mobs_creatures_crocodile_jump",
	},
	drops = {
		{name = "mobs:meat_raw", chance = 1, min = 1, max = 10},
		{name = "mobs:leather",	chance = 1, min = 1, max = 10},
	},
	visual = "mesh",
	visual_size = {x=9, y=9},
	collisionbox = {-1, -0.6, -0.8, 1, 0.7, 0.8},
	textures = {
		{"mobs_creatures_crocodile_1.png"},
		{"mobs_creatures_crocodile_2.png"},
	},
	child_texture = {
		{"mobs_creatures_crocodile.png"},
	},
	mesh = "mobs_creatures_crocodile.b3d",
	animation = {
		speed_normal = 10,
		speed_sprint = 20,
		stand_start = 50,
		stand_end = 120,
		walk_start = 1,
		walk_end = 40,
		punch_start = 130,
		punch_end = 145,
		punch_loop = false,
	},

	on_rightclick = function(self, clicker)

		-- feed or tame
		if mobs:feed_tame(self, clicker, 8, true, true) then return end
		if mobs:protect(self, clicker) then return end

		if self.owner == "" then
			self.owner = clicker:get_player_name()
		else
			if self.order == "follow" then
				self.order = "stand"
			else
				self.order = "follow"

			end

		end

	end,

	do_custom = function(self, dtime, nodef)

-- Mob changes animation and can swim in water

	local nodef = minetest.registered_nodes[self.standing_in]

        if nodef.groups.water then

        self.fly = true
        self.fly_in = "default:water_source"
        self.floats = 0
        self.view_range = 12
        self.walk_chance = 100
        self.animation = animation_water
	elseif not self:attempt_flight_correction() then

        self.fly = false
        self.floats = 0
        self.view_range = 8
        self.walk_chance = 10
        self.animation = animation_land
            return
	end

-- Behaviour for young mobs

	if self.child == true then
		self.type = "animal"
		self.passive = true
	        self.attack_animals = false
		self.walk_velocity = 0.3
		self.run_velocity = 0.3
		return
	end
	-- Can Lay Eggs
                self.egg_timer = (self.egg_timer or 0) + dtime
                if self.egg_timer < 5 then
                       return
                end
                self.egg_timer = 0

                if self.child
                or math.random(1, 100) > 1 then
                        return
                end

                local pos = self.object:get_pos()

                minetest.add_entity(pos, "mobs_creatures:crocodile_egg")
                minetest.sound_play("mobs_creatures_chicken_eggpop.ogg", {
                        pos = pos,
                        gain = 1.0,
                        max_hear_distance = 8,
                })
        end,
})

mobs:spawn_specific("mobs_creatures:crocodile", {"default:coral_brown", "default:coral_orange","default:coral_cyan","default:coral_green","default:coral_pink", "decorations_sea:seagrass_02", "decorations_sea:seagrass_03", "decorations_sea:seagrass_05", "decorations_sea:seagrass_06", "decorations_sea:coral_plantlike_01", "decorations_sea:coral_plantlike_02", "decorations_sea:coral_plantlike_03", "decorations_sea:coral_plantlike_04", "decorations_sea:coral_plantlike_05"}, {"default:water_source", "default:water_flowing", "default:river_water_source", "default:river_water_flowing"}, 0, 7, 240, 125, 2, -50, -1)
mobs:register_egg("mobs_creatures:crocodile", "Crocodile Spawn Egg", "default_silver_sand.png", 1)

-- CROCODILE EGG
mobs:register_mob("mobs_creatures:crocodile_egg", {
	type = "nil",
	hp_min = 5,
	hp_max = 5,
	armor = 200,
	passive = true,
	walk_velocity = 0,
	run_velocity = 0,
	jump = false,
	runaway = false,
        pushable = true,
	fear_height = 5,
	fall_damage = 0,
	fall_speed = -8,
	water_damage = 1,
	lava_damage = 5,
	light_damage = 0,
	collisionbox = {-0.2, -0.5, -0.2, 0.2, 0, 0.2},
	visual = "mesh",
	mesh = "mobs_creatures_egg.b3d",
	textures = {
		{"mobs_creatures_egg_3.png"},
	},
	makes_footstep_sound = false,
	animation = {
		speed_normal = 1,
		stand_start = 1,
		stand_end = 1,
		walk_start = 1,
		walk_end = 1,
	},

	do_custom = function(self, dtime)

		self.egg_timer = (self.egg_timer or 0) + dtime
		if self.egg_timer < 10 then
			return
		end
		self.egg_timer = 0

		if self.child
		or math.random(1, 100) > 1 then
			return
		end

		local pos = self.object:get_pos()

		mob = minetest.add_entity(pos, "mobs_creatures:crocodile")
                ent2 = mob:get_luaentity()
		self.object:remove()

		mob:set_properties({
			textures = ent2.child_texture[1],
			visual_size = {
				x = ent2.base_size.x / 2,
				y = ent2.base_size.y / 2
			},
			collisionbox = {
				ent2.base_colbox[1] / 2,
				ent2.base_colbox[2] / 2,
				ent2.base_colbox[3] / 2,
				ent2.base_colbox[4] / 2,
				ent2.base_colbox[5] / 2,
				ent2.base_colbox[6] / 2
			},
		})

		ent2.child = true
		ent2.tamed = false
	end
})

mobs:register_egg("mobs_creatures:crocodile_egg", "Crocodile Egg", "mobs_creatures_egg_3_inv.png", 0)


code:
--CYBERDEMON
mobs:register_mob("mobs_creatures:cyberdemon", {
        type = "monster",
        passive = false,
        reach = 6,
        damage = 2,
        attack_type = "shoot",
	shoot_interval = 2,
	arrow = "mobs_creatures:a_cyberdemon_rocket",
	shoot_offset = 1,
        hp_min = 666,
        hp_max = 666,
        armor = 100,
	visual = "mesh",
	mesh = "mobs_character.b3d",
	collisionbox = {-1.0,-3.0,-1.0, 1.0,2.4,1.0},
	visual_size = {x=3.0, y=3.0},
        textures = {
                {"mobs_creatures_cyberdemon.png"},
        },
	knock_back = false,
        makes_footstep_sound = true,
        walk_velocity = 1,
        run_velocity = 2.1,
        sounds = {
                distance = "32",
                random = "mobs_creatures_cyberdemon_random",
                war_cry = "mobs_creatures_cyberdemon_warcry",
                shoot_attack = "mobs_creatures_cyberdemon_shoot",
                death = "mobs_creatures_cyberdemon_death",
        },
        jump = true,
        drops = {
                {name = "bweapons_hitech_pack:missile_launcher", chance = 100, min = 1, max = 1}, -- Uses bweapons_modpack for drops
                {name = "bweapons_hitech_pack:missile", chance = 1, min = 1, max = 24},
        },
        water_damage = 0,
        lava_damage = 0,
        light_damage = 0,
        view_range = 32,
        animation = {
                speed_normal = 30,
                speed_run = 45,
                stand_start = 0,
                stand_end = 79,
                walk_start = 168,
                walk_end = 187,
                run_start = 168,
                run_end = 187,
                punch_start = 200,
                punch_end = 219,
                shoot_start = 200,
                shoot_end = 219,
        },
   on_die = function(self,pos)
                          mobs:explosion(pos, 3, 5, 3)
            end,
})
-- CYBERDEMON, EXPLOSIVE VERSION PROJECTILE
mobs:register_arrow("mobs_creatures:a_cyberdemon_rocket", {
   visual = "sprite",
   visual_size = {x = 1.0, y = 1.0},
   textures = {"mobs_creatures_arrow_rocket.png"},
   velocity = 15,
   tail = 1, -- enable tail
   glow = 5,
   tail_texture = "mobs_creatures_arrow_rocket_trail.png",

   hit_player = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 20},
      }, nil)
   end,

   hit_mob = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 20},
      }, nil)
   end,

   hit_node = function(self, pos, node)
        if minetest.get_node(pos).name ~= "default:cobble" then
              mobs:explosion(pos, 2, 2, 2)
        end
   end,
})

-- REGISTER SPAWN PARAMETERS
mobs:spawn_specific("mobs_creatures:cyberdemon", {"nether:sand","default:lava_source","nether:glowstone"},{"air"}, 0, 16, 600, 10000, 1, -30912, -16000)

-- REGISTER SPAWN EGG
mobs:register_egg("mobs_creatures:cyberdemon", "Cyberdemon Spawn Egg", "wool_red.png", 1)


code:
-- Register the Deer into the API.
mobs:register_mob("mobs_creatures:deer", {
        type = "animal",
        hp_min = 4,
        hp_max = 8,
        collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
        textures = {
                {"mobs_creatures_deer.png"},
        },
        visual = "mesh",
        mesh = "mobs_creatures_deer.x",
        makes_footstep_sound = true,
        walk_velocity = 1,
        armor = 200,
        drops = {
                {name = "mobs:meat_raw",
                chance = 1,
                min = 2,
                max = 3,},
        },
        drawtype = "front",
        water_damage = 1,
        lava_damage = 5,
        light_damage = 0,
        animation = {
                speed_normal = 15,
                stand_start = 25,               stand_end = 75,
                walk_start = 75,                walk_end = 100,
        },
        follow = "farming:wheat",
        view_range = 5,
})
-- Register the Spawning Parameters
mobs:spawn_specific("mobs_creatures:deer", {"default:dirt_with_coniferous_litter"}, {"default:fern_2"}, 6, 16, 60, 480, 2, 2, 150)

-- Register the Spawn Egg
mobs:register_egg("mobs_creatures:deer", "Deer Spawn Egg", "wool_brown.png", 1)


code:
-- DEMON EYE by FreeGamers.org
-- model by mobs_mc.
-- sounds from freedoom.
-- inspired by terraria.

mobs:register_mob("mobs_creatures:demon_eye", {
   type = "monster",
   passive = false,
   damage = 4,
   reach = 2,
   attack_type = "dogfight",
   hp_min = 10,
   hp_max = 10,
   armor = 125,
   knock_back = true,
   collisionbox = {-0.25, 0.25, -0.25, 0.25, 1.25, 0.25},
   visual = "mesh",
   mesh = "mobs_creatures_demon_eye.b3d",
   textures = {
      {"mobs_creatures_demon_eye.png"},
   },
   visual_size = {x=1.5, y=1.5},
   makes_footstep_sound = false,
   walk_velocity = 1,
   run_velocity = 2,
   jump = true,
   fly = true,
   floats = true,
   fall_speed = 0,
   stepheight = 1,
   water_damage = 5,
   lava_damage = 10,
   light_damage = 10,
   view_range = 16,
   sounds = {
        death = "mobs_creatures_demon_eye_death",
        damage = "mobs_creatures_demon_eye_damage",
        attack = "mobs_creatures_demon_eye_attack",
        },
   animation = {
	stand_speed = 50, walk_speed = 50, run_speed = 50,
	stand_start = 0,		stand_end = 40,
	walk_start = 0,		walk_end = 40,
	run_start = 0,		run_end = 40,
   },
   do_custom = function(self) -- Add downward particles of blood.
                local apos = self.object:getpos()
                minetest.add_particlespawner({
                       amount = 1.0, --amount
                       time = 1.0, --time
                       minpos =  {x=apos.x-0.3, y=apos.y-0, z=apos.z-0.3}, --minpos
                       maxpos = {x=apos.x+0.3, y=apos.y+1, z=apos.z+0.3}, --maxpos
                       minvel =  {x=-0, y=-0, z=-0}, --minvel
                       maxvel = {x=0, y=0, z=0}, --maxvel
                       minacc =  {x=0,y=-1,z=0}, --minacc
                       maxacc =  {x=0.5,y=-1.2,z=0.5}, --maxacc
                       minexptime = 1.0, --minexptime
                       maxexptime = 2.0, --maxexptime
                       minsize = 1.0, --minsize
                       maxsize = 1.0, --maxsize
                       collisiondetection = true, --collisiondetection
                       texture = "mobs_blood.png" --texture
                })
	end,
})
-- REGISTER SPAWN PARAMETERS
mobs:spawn_specific("mobs_creatures:demon_eye", {"group:leaves"}, {"air"}, 0, 6, 60, 2000, 4, 5, 175, false)

-- REGISTER SPAWN EGG
mobs:register_egg("mobs_creatures:demon_eye", "Demon Eye Spawn Egg", "wool_red.png", 1)


code:
-- Diamond Man by FreeGamers.org
-- Skin by TylerTDG

-- REGISTER DIAMOND MAN
mobs:register_mob("mobs_creatures:diamond_man", {
	type = "monster",
	passive = false,
	attack_type = "dogfight",
	reach = 2,
	damage = 15,
	hp_min = 30,
	hp_max = 30,
	armor = 25,
        collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
        visual = "mesh",
        mesh = "mobs_character.b3d",
        textures = {
                {"mobs_creatures_diamond_man.png"},
        },
	makes_footstep_sound = true,
	sounds = {
		random = "mobs_creatures_stone_man_random",
		damage = "default_break_glass",
		jump = "default_glass_footstep",
		death = "default_break_glass",
	},
        blood_texture = "default_diamond.png",
	walk_velocity = 1,
	run_velocity = 2,
	jump_height = 1,
	stepheight = 1.1,
	floats = 0,
	view_range = 12,
	drops = {
		{name = "default:diamond", chance = 20, min = 0, max = 2},
	},
	water_damage = 0,
	lava_damage = 5,
	light_damage = 0,
	suffocation = false,
	knock_back = false,
        animation = {
                speed_normal = 30,
                speed_run = 30,
                stand_start = 0,
                stand_end = 79,
                walk_start = 168,
                walk_end = 187,
                run_start = 168,
                run_end = 187,
                punch_start = 200,
                punch_end = 219,
        },
	immune_to = {
		{"default:pick_wood", 0}, -- wooden pick doesnt hurt diamond man
		{"default:pick_stone", 4}, -- picks deal more damage to diamond man.
		{"default:pick_bronze", 5},
		{"default:pick_steel", 5},
		{"default:pick_mese", 6},
		{"default:pick_diamond", 7},
	},
    on_die = function(self, pos) -- on die, spawn particles.
        minetest.add_particlespawner({
            amount = 100,
            time = 0.1,
            minpos = {x=pos.x-1, y=pos.y-1, z=pos.z-1},
            maxpos = {x=pos.x+1, y=pos.y+1, z=pos.z+1},
            minvel = {x=-0, y=-0, z=-0},
            maxvel = {x=1, y=1, z=1},
            minacc = {x=-0.5,y=5,z=-0.5},
            maxacc = {x=0.5,y=5,z=0.5},
            minexptime = 0.1,
            maxexptime = 1,
            minsize = 1,
            maxsize = 2,
            collisiondetection = false,
            texture="default_diamond.png"
        })
        self.object:remove()
    end,
})

-- Spawning Parameters
mobs:spawn_specific("mobs_creatures:diamond_man", {"group:cracky", "group:crumbly", "group:shovely", "group:pickaxey"}, {"air", "mine_gas:gas"}, 0, 7, 240, 12000, 1, -9500, -6500)

-- Register Spawn Egg
mobs:register_egg("mobs_creatures:diamond_man", "Diamond Man Spawn Egg", "default_diamond.png", 1)


code:
-- Original Dirt Monster concept by PilzAdam
-- Simplified version of "Dirt Golem" Skin by Nick_Nicany
-- Simplified by freegamers.org
-- Register mob with Mobs API
mobs:register_mob("mobs_creatures:dirt_man", {
	type = "monster",
	passive = false,
	attack_type = "dogfight",
	reach = 2,
	damage = 4,
	hp_min = 3,
	hp_max = 27,
	armor = 100,
	collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
	visual = "mesh",
        mesh = "mobs_character.b3d",
	textures = {
		{"mobs_creatures_dirt_man.png"},
	},
	blood_texture = "default_dirt.png",
	makes_footstep_sound = true,
	sounds = {
		random = "mobs_creatures_dirt_man_random",
		damage = "default_dirt_footstep",
		attack = "default_dirt_footstep",
		jump = "default_dirt_footstep",
		death = "default_dirt_footstep",
	},
	view_range = 15,
	walk_velocity = 1,
	run_velocity = 3,
	jump = true,
	drops = {
		{name = "default:dirt", chance = 1, min = 0, max = 2},
	},
	water_damage = 1,
	lava_damage = 5,
	light_damage = 3,
	fear_height = 4,
        animation = {
                speed_normal = 30,
                speed_run = 30,
                stand_start = 0,
                stand_end = 79,
                walk_start = 168,
                walk_end = 187,
                run_start = 168,
                run_end = 187,
                punch_start = 200,
                punch_end = 219,
        },
        immune_to = {
                {"default:shovel_wood", 3}, -- shovels deal more damage to dirt golem
                {"default:shovel_stone", 3},
                {"default:shovel_bronze", 4},
                {"default:shovel_steel", 4},
                {"default:shovel_mese", 5},
                {"default:shovel_diamond", 7},
        },
    on_die = function(self, pos) -- on die, spawn particles.
        minetest.add_particlespawner({
            amount = 100,
            time = 0.1,
            minpos = {x=pos.x-1, y=pos.y-1, z=pos.z-1},
            maxpos = {x=pos.x+1, y=pos.y+1, z=pos.z+1},
            minvel = {x=-0, y=-0, z=-0},
            maxvel = {x=1, y=1, z=1},
            minacc = {x=-0.5,y=5,z=-0.5},
            maxacc = {x=0.5,y=5,z=0.5},
            minexptime = 0.1,
            maxexptime = 1,
            minsize = 1,
            maxsize = 3,
            collisiondetection = false,
            texture="default_dirt.png"
        })
        self.object:remove()
    end,
})

-- Register Spawn Parameters
mobs:spawn_specific("mobs_creatures:dirt_man", {"default:dirt_with_grass", "ethereal:gray_dirt"}, {"air"}, 0, 7, 60, 5000, 2, -500, 100, false)

-- Register Spawn Egg
mobs:register_egg("mobs_creatures:dirt_man", "Dirt Man Spawn Egg", "default_dirt.png", 1)


code:
--###################
--################### DOLPHIN
--###################
-- originally from mc_mobs
--dolphin tail moves up and down 0 to 80
--dolphin tail moves up and down also body moves up and down 100 to 180

mobs:register_mob("mobs_creatures:dolphin", {
	type = "animal",
	group_attack = true,
	passive = true,
	runaway = true,
	attack_type = "dogfight",
	damage = 7,
	reach = 2,
	hp_min = 10,
	hp_max = 10,
	armor = 75,
	collisionbox = {-0.35, -0.01, -0.35, 0.35, 1, 0.35},
	visual = "mesh",
	mesh = "mobs_creatures_dolphin.b3d",
	textures = {
		{"mobs_creatures_dolphin.png"},
	},
        drops = {
               {name = "mobs_creatures:cod_raw", chance = 1, min = 0, max = 4},
        },
	visual_size = {x=3, y=3},
	walk_velocity = 0.6,
	run_velocity = 2,
	jump = false,
	fly = true,
	fly_in = "default:water_source",
	fall_speed = 0,
	stepheight = 0.1,
	view_range = 16,
	water_damage = 0,
	lava_damage = 10,
	light_damage = 0,
	animation = {
	        stand_speed = 25,
	        walk_speed = 25,
		run_speed = 50,
		stand_start = 0,
	        stand_end = 0,
		walk_start = 0,
	        walk_end = 80,
		run_start = 100,
	        run_end = 180,
	},
})
-- Register spawning conditions. -- prefers warmer waters
mobs:spawn_specific("mobs_creatures:dolphin",  {"default:wood", "default:tree", "default:coral_brown", "default:coral_orange","default:coral_cyan","default:coral_green","default:coral_pink", "decorations_sea:seagrass_02", "decorations_sea:seagrass_03", "decorations_sea:seagrass_05", "decorations_sea:seagrass_06", "decorations_sea:coral_plantlike_01", "decorations_sea:coral_plantlike_02", "decorations_sea:coral_plantlike_03", "decorations_sea:coral_plantlike_04", "decorations_sea:coral_plantlike_05"}, {"default:water_flowing","default:water_source"}, 1, 16, 60, 250, 4, -100, -2)

-- Register spawn egg.
mobs:register_egg("mobs_creatures:dolphin", "Dolphin Spawn Egg", "default_water.png", 1)


code:
-- By FreeGamers.org
-- Facehuggers inspired by Alien,Aliens.
-- Texture, model, and foundation from "mobs_scifi" by D00Med.
mobs:register_mob("mobs_creatures:facehugger", {
   type = "monster",
   passive = false,
   attacks_monsters = false,
   damage = 5,
   reach = 2,
   attack_type = "dogfight",
   hp_min = 5,
   hp_max = 5,
   armor = 100,
   collisionbox = {-0.3, -0.1, -0.3, 0.3, 0.1, 0.3},
   visual = "mesh",
   mesh = "mobs_creatures_facehugger.b3d",
   textures = {
      {"mobs_creatures_facehugger.png"},
   },
   sounds = {
            random ="mobs_creatures_facehugger_random",
            jump = "mobs_creatures_facehugger_jump",
            damage = "mobs_creatures_facehugger_damage",
            death = "mobs_creatures_facehugger_death",
   },
   blood_texture = "mobs_blood.png",
   visual_size = {x=1, y=1},
   makes_footstep_sound = true,
   walk_velocity = 1,
   run_velocity = 3,
   jump = true,
   stepheight = 1.5,
   water_damage = 0,
   lava_damage = 2,
   light_damage = 0,
   view_range = 7,
   animation = {
      speed_normal = 12,
      speed_run = 20,
      walk_start = 10,
      walk_end = 30,
      run_start = 10,
      run_end = 30,
      punch_start = 30,
      punch_end = 43,
   },
--    do_custom = function(self)
--                 local pos = self.object:getpos()
--                 local objs = minetest.get_objects_inside_radius(pos, 2)
--                 for _, obj in pairs(objs) do
--                         if obj:is_player() and obj:get_attach() == nil then
--                                         obj:set_attach(self.object, "", {x=.2, y=15, z=3}, {x=-100, y=225, z=90})
--                                         self.object:set_animation({x=46, y=46}, 20, 0)
--                                 end
--                         end
--    end,
--    on_die = function(
})
-- Register Spawn Egg
mobs:register_egg("mobs_creatures:facehugger", "Facehugger Spawn Egg", "default_obsidian.png", 1)

-- Register Spawn Parameters
--mobs:spawn_specific("mobs_creatures:facehugger", {"default:dirt_with_dry_grass"}, {"default:stone"}, 20, 0, 300, 15000, 2, 31000, 31001)


code:
-- FIREIMP BY FREEGAMERS.ORG
-- INSPIRED BY DWARF FORTRESS.

-- BUG: FIRE IMPS ARE NOT FLOATING IN LAVA.

-- FIRE IMP
mobs:register_mob("mobs_creatures:fire_imp", {
   type = "monster",
   passive = false,
   damage = 4,
   reach = 2,
   attack_type = "dogshoot",
   shoot_interval = 2.5,
   dogshoot_switch = 2,
   dogshoot_count = 0,
   dogshoot_count_max =2,
   arrow = "mobs_creatures:fire_imp_fireball",
   shoot_offset = 1.5,
   hp_min = 10,
   hp_max = 10,
   armor = 100,
   collisionbox = {-0.25,-0.5,-0.25, 0.25,0.4,0.25},
   visual = "mesh",
   mesh = "mobs_character.b3d",
   textures = {
      {"mobs_creatures_fire_imp.png"},
   },
   blood_amount = 8,
   visual_size = {x=0.5, y=0.5},
   makes_footstep_sound = true,
   walk_velocity = 2,
   suffocation = false,
   run_velocity = 2.5,
   floats = 1,
   jump = true,
-- not sure if this works without fly enabled.   fly_in = "default:lava_source",
   sounds = {
                distance = "16",
                random = "mobs_creatures_fire_imp_random",
                attack = "mobs_creatures_fire_imp_attack",
                shoot_attack = "mobs_creatures_common_shoot_fireball",
                damage = "mobs_creatures_fire_imp_damage",
                death = "mobs_creatures_fire_imp_death",
   },
   drops = {
      {name = "mobs:meat", chance = 1, min = 1, max = 2},
      {name = "mobs:leather", chance =1, min = 1, max = 1},
      {name = "mobs_creatures:bone", chance = 1, min = 1, max = 3},
   },
   water_damage = 0,
   lava_damage = 0,
   light_damage = 0,
   view_range = 12,
   animation = {
          speed_normal = 30,
          speed_run = 30,
          stand_start = 0,
          stand_end = 79,
          walk_start = 168,
          walk_end = 187,
          run_start = 168,
          run_end = 187,
          punch_start = 200,
          punch_end = 219,
        },
        do_custom = function(self, dtime, nodef)
	-- heats up water if it comes into contact with it and it evaporates.
        local pos = self.object:getpos()
        if minetest.get_node(pos).name == "default:water_source" or minetest.get_node(pos).name == "default:water_flowing" or minetest.get_node(pos).name == "default:river_water_source" or minetest.get_node(pos).name == "default:river_water_flowing" or minetest.get_node(pos).name == "default:snow" or minetest.get_node(pos).name == "default:ice" then
                minetest.add_particlespawner({
                        amount = 1,
                        time = 1,
                        minpos = pos,
                        maxpos = pos,
                        minvel = {x=-1, y=0, z=-1},
                        maxvel = {x=1, y=1, z=1},
                        minacc = {x=0, y=2, z=0},
                        maxacc = {x=0, y=2, z=0},
                        minexptime = 1,
                        maxexptime = 2,
                        minsize = 4,
                        maxsize = 8,
                        collisiondetection = false,
                        vertical = false,
                        texture = "smoke_puff.png",
                })
                minetest.sound_play({name = "default_cool_lava", gain = 1.0}, {pos=pos, max_hear_distance = 16})
                minetest.set_node(pos, {name = "air"})
        else
                return
        end
    end,
    on_die = function(self, pos) -- on die, spawn a fire:permanent flame.
        if minetest.get_node(pos).name == "air" then
                minetest.set_node(pos, {name = "fire:permanent_flame"})
        end
        self.object:remove()
    end,
})
-- FIRE IMP PROJECTILE
mobs:register_arrow("mobs_creatures:fire_imp_fireball", {
   visual = "sprite",
   visual_size = {x = 0.5, y = 0.5},
   textures = {"mobs_creatures_arrow_fireball.png"},
   velocity = 7,
   glow = 5,
   tail = 1, -- enable tail
   tail_texture = "mobs_creatures_arrow_fireball_trail.png",
   hit_player = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 32},
      }, nil)
       minetest.sound_play({name = "mobs_creatures_common_shoot_fireball_hit", gain = 1.0}, {pos=player:getpos(), max_hear_distance = 12})
   end,

   hit_mob = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 32},
      }, nil)
   end,

   hit_node = function(self, pos, node)
        minetest.sound_play({name = "mobs_creatures_common_shoot_fireball_hit", gain = 1.0}, {pos=pos, max_hear_distance = 12})
	minetest.set_node(pos, {name = "fire:permanent_flame"})
	self.object:remove()
   end,
})
-- REGISTER SPAWN PARAMETERS
mobs:spawn_specific("mobs_creatures:fire_imp",  {"default:cobblestone", "default:stone", "magma_conduits:hot_cobble", "magma_conduits:glow_obsidian", "magma_conduits:stone", "group:stone"}, {"default:lava_flowing", "default:lava_source"}, 0, 20, 120, 2500, 6, -15500, 0)

-- REGISTER SPAWN EGG
mobs:register_egg("mobs_creatures:fire_imp", "Fire Imp Spawn Egg", "default_lava.png", 1)


code:
-- FIRE ELEMENTAL
-- INSPIRED BY THE FIREMAN FROM DWARF FORTRESS
-- Texture by DukeMaster123
-- TODO: Drops ash and lye.
mobs:register_mob("mobs_creatures:fire_man", {
   type = "monster",
   passive = false,
   attacks_monsters = false,
   damage = 4,
   reach = 2,
   attack_type = "dogshoot",
   arrow = "mobs_creatures:fire_man_fireball",
   shoot_interval = 2.5,
   dogshoot_switch = 2,
   dogshoot_count = 0,
   dogshoot_count_max =2,
   hp_min = 10,
   hp_max = 10,
   armor = 200,
   knock_back = false,
   collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
   visual = "mesh",
   mesh = "mobs_character.b3d",
   textures = {
  	    {"mobs_creatures_fire_man.png"},
   },
   animation = {
        speed_normal = 30,
        speed_run = 30,
        stand_start = 0,
        stand_end = 79,
        walk_start = 168,
        walk_end = 187,
        run_start = 168,
        run_end = 187,
        punch_start = 200,
        punch_end = 219,
   },
   blood_amount = 60,
   blood_texture = "fire_basic_flame.png",
   makes_footstep_sound = true,
   walk_velocity = 1,
   run_velocity = 2,
   jump = true,
   fly = false,
   water_damage = 0,
   lava_damage = 0,
   light_damage = 0,
   view_range = 16,
   sounds = {
	death = "fire_extinguish_flame",
        shoot_attack = "mobs_creatures_common_shoot_fireball",
	random = "fire_fire",
	},
   drops = {
--		{name = "mobs_creatures:ash", chance = 1, min = 1, max = 4}
	},
   do_custom = function(self)
		local apos = self.object:getpos()
		minetest.add_particlespawner({
			1, --amount
			0.3, --time
			{x=apos.x-0.3, y=apos.y-1, z=apos.z-0.3}, --minpos
			{x=apos.x+0.3, y=apos.y+1, z=apos.z+0.3}, --maxpos
			{x=-0, y=-0, z=-0}, --minvel
			{x=0, y=0, z=0}, --maxvel
			{x=0,y=1,z=0}, --minacc
			{x=0.5,y=1.2,z=0.5}, --maxacc
			3, --minexptime
			4, --maxexptime
			1, --minsize
			3, --maxsize
			true, --collisiondetection
			"fire_basic_flame.png" --texture
		})
		-- if standing in water, remove replace with air play steam.
		local pos = self.object:getpos()
                if minetest.get_node(pos).name == "default:water_source" or minetest.get_node(pos).name == "default:water_flowing" or minetest.get_node(pos).name == "default:river_water_source" or minetest.get_node(pos).name == "default:river_water_flowing" or minetest.get_node(pos).name == "default:snow" or minetest.get_node(pos).name == "default:ice" then
			minetest.add_particlespawner({
				amount = 1,
				time = 1,
				minpos = pos,
				maxpos = pos,
				minvel = {x=-1, y=0, z=-1},
				maxvel = {x=1, y=1, z=1},
				minacc = {x=0, y=2, z=0},
				maxacc = {x=0, y=2, z=0},
				minexptime = 1,
				maxexptime = 2,
				minsize = 4,
				maxsize = 8,
				collisiondetection = false,
				vertical = false,
				texture = "smoke_puff.png",
			})
		      	minetest.sound_play({name = "default_cool_lava", gain = 1.0}, {pos=pos, max_hear_distance = 16})
			minetest.set_node(pos, {name = "air"})
		else
			return
		end
    end,
    on_die = function(self, pos) -- on die, spawn particles.
        minetest.add_particlespawner({
            amount = 100,
            time = 0.1,
            minpos = {x=pos.x-1, y=pos.y-1, z=pos.z-1},
            maxpos = {x=pos.x+1, y=pos.y+1, z=pos.z+1},
            minvel = {x=-0, y=-0, z=-0},
            maxvel = {x=1, y=1, z=1},
            minacc = {x=-0.5,y=5,z=-0.5},
            maxacc = {x=0.5,y=5,z=0.5},
            minexptime = 0.1,
            maxexptime = 1,
            minsize = 1,
            maxsize = 3,
            collisiondetection = false,
            texture="fire_basic_flame.png"
        })
        self.object:remove()
    end,
})
-- FIRE ELEMENTAL FIREBALL PROJECTILE
mobs:register_arrow("mobs_creatures:fire_man_fireball", {
   visual = "sprite",
   visual_size = {x = 0.5, y = 0.5},
   textures = {"mobs_creatures_arrow_fireball.png"},
   velocity = 7,
   glow = 5,
   tail = 1, -- enable tail
   tail_texture = "mobs_creatures_arrow_fireball_trail.png",
   hit_player = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 32},
      }, nil)
       minetest.sound_play({name = "mobs_creatures_common_shoot_fireball_hit", gain = 1.0}, {pos=player:getpos(), max_hear_distance = 12})
   end,

   hit_mob = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 32},
      }, nil)
   end,

   hit_node = function(self, pos, node)
        minetest.sound_play({name = "mobs_creatures_common_shoot_fireball_hit", gain = 1.0}, {pos=pos, max_hear_distance = 12})
        minetest.set_node(pos, {name = "fire:permanent_flame"})
        self.object:remove()
   end,
})
-- REGISTER SPAWN PARAMETERS
mobs:spawn_specific("mobs_creatures:fire_man", {"default:cobblestone", "default:stone", "magma_conduits:hot_cobble", "magma_conduits:glow_obsidian","magma_conduits:stone", "group:stone"}, {"default:lava_flowing", "default:lava_source"}, 0, 16, 240, 12000, 2, -12499,-6500)

-- REGISTER SPAWN EGG
mobs:register_egg("mobs_creatures:fire_man", "Fire Man Spawn Egg", "fire_basic_flame.png", 1)


code:
-- Flying Saucer
-- TODO: Add Drops.
mobs:register_mob("mobs_creatures:flying_saucer", {
   type = "monster",
   passive = false,
   damage = 100,
   reach = 3,
   attack_type = "shoot",
   shoot_interval = 3,
   arrow = "mobs_creatures:a_devastator_energy_cannon",
   shoot_offset = 0.5,
   hp_min = 50,
   hp_max = 50,
   armor = 35,
   collisionbox = {-3, -0.25, -3,  3, 3,  3},
   visual = "mesh",
   mesh = "mobs_creatures_flying_saucer.x",
   textures = {
      {"mobs_creatures_flying_saucer.png"},
   },
   blood_amount = 10,
   blood_texture = "default_steel_block.png",
   visual_size = {x=2, y=2},
   makes_footstep_sound = false,
   walk_velocity = 8,
   run_velocity = 10,
        sounds = {
                distance = "32",
                random = "mobs_creatures_flying_saucer_random",
                war_cry = "mobs_creatures_flying_saucer_warcry",
                shoot_attack = "mobs_creatures_common_shoot_plasmaball",
                damage = "mobs_creatures_flying_saucer_damage",
                death = "mobs_creatures_flying_saucer_death",
        },
   jump = true,
   fly = true,
   fall_speed = 0,
   stepheight = 10,
   water_damage = 0,
   lava_damage = 0,
   light_damage = 0,
   view_range = 24,
   on_die = function(self,pos)
                          minetest.add_entity(pos, "mobs_creatures:grey_enlisted")
			  mobs:explosion(pos, 2, 1, 2)
            end

})

--Spawn Paramters, on the Moon, above surface, in vacuum.
mobs:spawn_specific("mobs_creatures:flying_saucer", {"vacuum:vacuum"}, {"vacuum:vacuum"}, 0, 8, 480, 12000, 1, 3320, 3330, false)

-- Register Spawn Egg.
mobs:register_egg("mobs_creatures:flying_saucer", "Flying Saucer Spawn Egg", "default_steel_block.png", 1)

-- Register Devastator Energy Projectile
mobs:register_arrow("mobs_creatures:a_devastator_energy_cannon", {
   visual = "sprite",
   visual_size = {x = 2, y = 2},
   textures = {"mobs_creatures_arrow_plasmaball.png"},
   velocity = 16,
   glow = 5,
   tail = 1, -- enable tail
   tail_texture = "mobs_creatures_arrow_plasmaball_trail.png",

   hit_player = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 100},
      }, nil)
         minetest.sound_play({name = "mobs_creatures_common_shoot_plasmaball_hit", gain = 1.0}, {pos=player:getpos(), max_hear_distance = 16})
   end,

   hit_mob = function(self, player)
      player:punch(self.object, 1.0, {
         full_punch_interval = 1.0,
         damage_groups = {fleshy = 100},
      }, nil)
   end,

   hit_node = function(self, pos, node)
      minetest.sound_play({name = "mobs_creatures_common_shoot_plasmaball_hit", gain = 1.0}, {pos=pos, max_hear_distance = 16})
      self.object:remove()
   end,
})

-------- CREDITS AND ATTRIBUTIONS --------
-- Mob concept and implementation by FreeGamers.org
-- Flying Saucer model by Melkor
-- Flying Saucer texture by Pilcrow182, based on Melkor's textures for Zeg9's UFO mod.
-- Flying Saucer - JarAxe https://freesound.org/people/JarAxe/packs/13053/
-- Flying Saucer Engine- humanoide9000 https://freesound.org/people/humanoide9000/sounds/422245/
-- Flying Saucer tone - Timbre https://freesound.org/people/Timbre/sounds/92908/


code:
-- GHOST BY FREEGAMERS.ORG, RESTLESS, FOLLOWS PLAYERS
-- DESCRIPTION: A spirit that wanders due to an unproper burial. Is not physical. Will haunt players until they are properly memoralized.
-- TODO: FIGURE OUT HOW TO WORK WITH LADDERS AND SHAFTS
mobs:register_mob('mobs_creatures:ghost', {
	type = "animal",
	passive = false,
	group_attack = true,
	attack_type = "dogfight",
	reach = 2,
	damage = 0,
	hp_min = 10,
	hp_max = 10,
	armor = 100,
	knock_back = false,
        collisionbox = {0.0,-1.0,0.0, 0.0,0.0,0.0},
        visual = "mesh",
        mesh = "mobs_character.b3d",
        textures = {
                {"mobs_creatures_ghost.png"},
        },
	blood_amount = 0,
	makes_footstep_sound = false,
	sounds = {
		random = "mobs_creatures_ghost_random",
		 death = "mobs_creatures_ghost_death",
		attack = "mobs_creatures_ghost_attack",
		damage = "mobs_creatures_ghost_damage",
		warcry = "mobs_creatures_ghost_warcry",
	},
	walk_velocity = 1,
	run_velocity = 4,
	jump = true,
	fly = true,
	floats = true,
	suffocation = false,
	view_range = 32,
	drops = {
	},
	stay_near = {nodes = "mesecraft_bones:bones", chance = 5}, -- Will search for its bones and attempt to bury itself.
	follow = "mesecraft_bones:bones",	-- Will follow players holding bones.
	lava_damage = 0,
	water_damage = 0,
	light_damage = 0,
	fall_damage = 0,
        animation = {
                speed_normal = 0,
                speed_run = 79,
                stand_start = 0,
                stand_end = 79,
                walk_start = 0,
                walk_end = 79,
                run_start = 0,
                run_end = 79,
                punch_start = 0,
                punch_end = 79,
        },
	do_custom = function(self, pos)	-- ghosts will stay to haunt if there is no proper burial (gravestone) or if bones are still present.
		local checkpos = self.object:getpos()
		local gravecheck = minetest.find_node_near(checkpos, 8, {"group:gravestone"})
		local bonecheck = minetest.find_node_near(checkpos, 8 ,{"mesecraft_bones:bones"})
		if gravecheck == nil then				-- ghost stays to haunt
			return
		elseif bonecheck == nil and gravecheck ~= nil then	-- ghost can pass on
			minetest.sound_play({name = "mobs_creatures_ghost_warcry", gain = 1.0}, {pos=checkpos, max_hear_distance = 12})
			minetest.add_particlespawner({
			            amount = 10,
			            time = 1.0,
			            minpos = checkpos,
			            maxpos = checkpos,
			            minvel = {x=-0, y=-0, z=-0},
			            maxvel = {x=1, y=1, z=1},
			            minacc = {x=-0.3,y=3,z=-0.3},
			            maxacc = {x=0.5,y=5,z=0.5},
			            minexptime = 1,
			            maxexptime = 5,
			            minsize = 1,
			            maxsize = 3,
			            collisiondetection = false,
			            texture="default_item_smoke.png"
			        })
		        self.object:remove()
		end
		-- If the ghost is not in air, then it can go through walls and fly (so he doesnt fall through the ground).
		if minetest.get_node(checkpos).name ~= "air" then
			self.collisionbox = {0,0,0,0,0,0}
		end
	end,
})

--Spawn Eggs
mobs:register_egg("mobs_creatures:ghost", "Ghost Spawn Egg", "wool_white.png", 1)

--Spawn Functions
mobs:spawn_specific("mobs_creatures:ghost", {"mesecraft_bones:bones"}, {"air"}, 0, 16, 300, 100, 2, -30912, 30912, false)


code:
-- GHOST BY FREEGAMERS.ORG, MURDEROUS, ATTACKS PLAYERS
-- DESCRIPTION: A spirit that wanders due to an unproper burial. Is not physical. Will haunt players until they are properly memoralized.
-- TODO: FIGURE OUT HOW TO WORK WITH LADDERS AND SHAFTS
mobs:register_mob("mobs_creatures:murderous_ghost", {
	type = "monster",
	passive = false,
	group_attack = true,
	attack_type = "dogfight",
	reach = 2,
	damage = 8,
	hp_min = 10,
	hp_max = 10,
	armor = 100,
	knock_back = false,
        collisionbox = {0.0,-1.0,0.0, 0.0,0.0,0.0},
        visual = "mesh",
        mesh = "mobs_character.b3d",
        textures = {
                {"mobs_creatures_ghost_murderous.png"},
        },
	blood_amount = 0,
	makes_footstep_sound = false,
	sounds = {
		random = "mobs_creatures_ghost_random",
		 death = "mobs_creatures_ghost_death",
		attack = "mobs_creatures_ghost_attack",
		damage = "mobs_creatures_ghost_damage",
		warcry = "mobs_creatures_ghost_warcry",
	},
	walk_velocity = 1,
	run_velocity = 3.75,
	jump = true,
	fly = true,
	floats = true,
	suffocation = false,
	view_range = 12,
	drops = {
	},
	stay_near = {nodes = "mesecraft_bones:bones", chance = 4}, -- Will search for its bones and attempt to bury itself. (restless ghost just follows players)
	follow = "mesecraft_bones:bones",	-- Will follow players holding bones.
	lava_damage = 0,
	water_damage = 0,
	light_damage = 0,
	fall_damage = 0,
        animation = {
                speed_normal = 0,
                speed_run = 79,
                stand_start = 0,
                stand_end = 79,
                walk_start = 0,
                walk_end = 79,
                run_start = 0,
                run_end = 79,
                punch_start = 0,
                punch_end = 79,
        },
	do_custom = function(self, pos)	-- ghosts will stay to haunt if there is no proper burial (gravestone) or if bones are still present.
		local checkpos = self.object:getpos()
		local gravecheck = minetest.find_node_near(checkpos, 8, {"group:gravestone"})
		local bonecheck = minetest.find_node_near(checkpos, 8 ,{"mesecraft_bones:bones"})
		if gravecheck == nil then				-- ghost stays to haunt
			return
		elseif bonecheck == nil and gravecheck ~= nil then	-- ghost can pass on
			minetest.sound_play({name = "mobs_creatures_ghost_death", gain = 1.0}, {pos=checkpos, max_hear_distance = 12})
			minetest.add_particlespawner({
			            amount = 10,
			            time = 1.0,
			            minpos = checkpos,
			            maxpos = checkpos,
			            minvel = {x=-0, y=-0, z=-0},
			            maxvel = {x=1, y=1, z=1},
			            minacc = {x=-0.3,y=3,z=-0.3},
			            maxacc = {x=0.5,y=5,z=0.5},
			            minexptime = 1,
			            maxexptime = 5,
			            minsize = 1,
			            maxsize = 3,
			            collisiondetection = false,
			            texture="default_item_smoke.png"
			        })
		        self.object:remove()
		end
		-- If the ghost is not in air, then it can go through walls and fly (so he doesnt fall through the ground).
		if minetest.get_node(checkpos).name ~= "air" then
			self.collisionbox = {0,0,0,0,0,0}
		end
                minetest.add_particlespawner({
                        1, --amount
                        0.3, --time
                        {x=checkpos.x-0.3, y=checkpos.y+0.0, z=checkpos.z-0.3}, --minpos
                        {x=checkpos.x+0.3, y=checkpos.y+0.0, z=checkpos.z+0.3}, --maxpos
                        {x=-0, y=-0, z=-0}, --minvel
                        {x=0, y=0, z=0}, --maxvel
                        {x=0,y=1,z=0}, --minacc
                        {x=0.5,y=1.2,z=0.5}, --maxacc
                        3, --minexptime
                        5, --maxexptime
                        2, --minsize
                        3, --maxsize
                        true, --collisiondetection
                        "mobs_creatures_common_shadow.png" --texture
	                })
	end,
})

--Spawn Eggs
mobs:register_egg("mobs_creatures:murderous_ghost", "Murderous Ghost Spawn Egg", "wool_black.png", 1)

--Spawn Functions
mobs:spawn_specific("mobs_creatures:murderous_ghost", {"mesecraft_bones:bones"}, {"air"}, 0, 7, 240, 300, 2, -30912, -500)