From cbac52f407614e1ba99b40f3feec5dcfe35ad0b7 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sun, 4 Mar 2018 15:45:09 +0000 Subject: [PATCH] animals spawn near grass now (chance amended to suit) --- bee.lua | 4 ++-- bunny.lua | 3 ++- chicken.lua | 5 +++-- cow.lua | 13 ++++--------- kitten.lua | 14 +++++++++++--- sheep.lua | 11 +++-------- warthog.lua | 5 ++++- 7 files changed, 29 insertions(+), 26 deletions(-) diff --git a/bee.lua b/bee.lua index a0bcd82..4a85091 100644 --- a/bee.lua +++ b/bee.lua @@ -48,8 +48,8 @@ mobs:spawn({ name = "mobs_animal:bee", nodes = {"group:flower"}, min_light = 10, - chance = 9000, - min_height = 0, + chance = 5000, + min_height = 3, max_height = 200, day_toggle = true, }) diff --git a/bunny.lua b/bunny.lua index 108dffc..cbde3e7 100644 --- a/bunny.lua +++ b/bunny.lua @@ -115,8 +115,9 @@ end mobs:spawn({ name = "mobs_animal:bunny", nodes = {spawn_on}, + neighbors = {"group:grass"}, min_light = 10, - chance = 15000, + chance = 5000, -- 15000 min_height = 5, max_height = 200, day_toggle = true, diff --git a/chicken.lua b/chicken.lua index d19ebef..f79579d 100644 --- a/chicken.lua +++ b/chicken.lua @@ -95,10 +95,11 @@ end mobs:spawn({ name = "mobs_animal:chicken", nodes = {spawn_on}, + neighbors = {"group:grass"}, min_light = 10, - chance = 15000, + chance = 5000, -- 15000 active_object_count = 2, - min_height = 0, + min_height = 5, max_height = 200, day_toggle = true, }) diff --git a/cow.lua b/cow.lua index 545be46..e5ae7c7 100644 --- a/cow.lua +++ b/cow.lua @@ -101,18 +101,13 @@ mobs:register_mob("mobs_animal:cow", { }) -local spawn_on = "default:dirt_with_grass" - -if minetest.get_modpath("ethereal") then - spawn_on = "ethereal:green_dirt" -end - mobs:spawn({ name = "mobs_animal:cow", - nodes = {spawn_on}, + nodes = {"default:dirt_with_grass", "ethereal:green_dirt"}, + neighbors = {"group:grass"}, min_light = 10, - chance = 15000, - min_height = 0, + chance = 5000, -- 15000 + min_height = 5, max_height = 200, day_toggle = true, }) diff --git a/kitten.lua b/kitten.lua index 5be8e90..318fbda 100644 --- a/kitten.lua +++ b/kitten.lua @@ -53,12 +53,20 @@ stepheight = 0.6, }) +local spawn_on = "default:dirt_with_grass" + +if minetest.get_modpath("ethereal") then + spawn_on = "ethereal:grove_dirt" +end + + mobs:spawn({ name = "mobs_animal:kitten", - nodes = {"default:dirt_with_grass", "ethereal:grove_dirt"}, + nodes = {spawn_on}, + neighbors = {"group:grass"}, min_light = 12, - chance = 22000, - min_height = 0, + chance = 10000, -- 22000 + min_height = 5, max_height = 200, day_toggle = true, }) diff --git a/sheep.lua b/sheep.lua index 2da35d1..7335cd3 100644 --- a/sheep.lua +++ b/sheep.lua @@ -189,17 +189,12 @@ stepheight = 0.6, end -local spawn_on = "default:dirt_with_grass" - -if minetest.get_modpath("ethereal") then - spawn_on = "ethereal:green_dirt" -end - mobs:spawn({ name = "mobs_animal:sheep_white", - nodes = {spawn_on}, + nodes = {"default:dirt_with_grass", "ethereal:green_dirt"}, + neighbors = {"group:grass"}, min_light = 10, - chance = 15000, + chance = 5000, -- 15000 min_height = 0, max_height = 200, day_toggle = true, diff --git a/warthog.lua b/warthog.lua index c3c198e..7215531 100644 --- a/warthog.lua +++ b/warthog.lua @@ -59,16 +59,19 @@ stepheight = 0.6, local spawn_on = "default:dirt_with_grass" +local spawn_by = {"group:grass"} if minetest.get_modpath("ethereal") then spawn_on = "ethereal:mushroom_dirt" + spawn_by = {"flowers:mushroom_brown", "flowers:mushroom_brown"} end mobs:spawn({ name = "mobs_animal:pumba", nodes = {spawn_on}, + neighbors = spawn_by, min_light = 10, - chance = 15000, + chance = 5000, -- 15000 min_height = 0, max_height = 200, day_toggle = true,