-- disable petz spawning petz.settings.spawn_interval = math.huge local function combine(...) local ts = { ... } local t = {} for i = 1, #ts do for j = 1, #ts[i] do t[#t + 1] = ts[i][j] end end return t end local grass = { "default:dirt_with_grass", "ethereal:grove_dirt", "ethereal:prairie_dirt", "woodsoils:grass_with_leaves_1", "woodsoils:grass_with_leaves_2", } local dry_grass = { "default:dirt_with_dry_grass", "default:dry_dirt", "default:dry_dirt_with_dry_grass", } local jungle = { "default:dirt_with_rainforest_litter", "ethereal:jungle_dirt", } local cold = { "default:dirt_with_coniferous_litter", "ethereal:crystal_dirt", "ethereal:cold_dirt", "ethereal:gray_dirt", } local snow = { "default:dirt_with_snow", "default:snowblock", } local hot = { "ethereal:dry_dirt", "ethereal:fiery_dirt", "ethereal:mushroom_dirt", } local dirt = { "default:dirt", "woodsoils:dirt_with_leaves_1", "woodsoils:dirt_with_leaves_2", } local desert = { "group:sand", "default:desert_sandstone", "default:sandstone" } spawnit.register({ entity_name = "petz:bat", groups = { animal = 1 }, chance = yl_spawnit.base_chance * 5, within = { "breathable airlike" }, on = { "any" }, max_y = 5000, max_node_light = 5, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dusk, max_time_of_day = yl_spawnit.dawn, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:beaver", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6, within = { "default:river_water_source" }, on = { "any" }, min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:bunny", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6 * 3, cluster = 3, on = combine(grass, dry_grass), min_y = 0, max_y = 5000, max_in_area = 3, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:butterfly", groups = { animal = 1 }, chance = yl_spawnit.base_chance, on = { "any" }, near = { "group:flower" }, min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 3, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:calf", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6 * 3, cluster = 3, on = combine(grass, dry_grass), min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 3, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:camel", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6, on = desert, min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:chimp", groups = { animal = 1 }, chance = yl_spawnit.base_chance, on = combine(jungle, { "default:jungleleaves", "moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_red", "ethereal:palmleaves", "moretrees:date_palm_leaves", "moretrees:palm_leaves", }), min_y = 0, max_y = 5000, min_node_light = 8, max_in_area = 2, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:clownfish", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 25, cluster = 3, within = { "default:water_source" }, on = { "any" }, near = { "group:coral" }, min_y = -100, max_y = 1, min_node_light = 2, max_in_area = 3, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:dolphin", groups = { animal = 1 }, chance = yl_spawnit.base_chance * 2, within = { "default:water_source" }, on = { "any" }, min_y = -100, max_y = 1, min_node_light = 2, max_in_area = 1, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:ducky", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6, on = { "group:soil", "group:water" }, min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 3, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:elephant", groups = { animal = 1 }, chance = yl_spawnit.base_chance, on = combine(dry_grass, jungle), min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:elephant_female", groups = { animal = 1 }, chance = yl_spawnit.base_chance, on = combine(dry_grass, jungle), min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:flamingo", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.8, on = hot, near = { "group:water" }, min_y = 0, max_y = 15, min_node_light = 12, max_in_area = 2, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:foxy", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.8 * 2, on = combine(grass, dry_grass, cold, snow, dirt, { "ethereal:bamboo_dirt" }), min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:frog", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6, within = { "default:river_water_source" }, on = { "any" }, min_y = 0, max_y = 5000, min_node_light = 8, max_in_area = 2, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:gecko", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.8, on = jungle, min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:goat", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6 * 3, cluster = 3, on = combine(grass, dry_grass), min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 3, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:grizzly", groups = { animal = 1, hostile = 1 }, chance = yl_spawnit.base_chance * 2, on = combine(grass, cold, jungle), min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, min_player_distance = 12, spawn_in_protected = false, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:hamster", groups = { animal = 1 }, chance = yl_spawnit.base_chance * 3, on = desert, min_y = 0, max_y = 5000, max_in_area = 2, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:hen", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6, on = combine(grass, jungle), min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 2, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:kitty", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6 * 2, on = combine(grass, cold, jungle, desert), min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dusk, max_time_of_day = yl_spawnit.dawn, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:lamb", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6 * 3, cluster = 3, on = combine(grass, dry_grass), min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 3, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:leopard", groups = { animal = 1, hostile = 1 }, chance = yl_spawnit.base_chance, on = dry_grass, min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, min_player_distance = 12, spawn_in_protected = false, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:lion", groups = { animal = 1, hostile = 1 }, chance = yl_spawnit.base_chance, on = dry_grass, min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, min_player_distance = 12, spawn_in_protected = false, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:moth", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.8 * 3, on = { "any" }, min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) -- shouldn't spawn --spawnit.register({ -- entity_name = "petz:mr_pumpkin", -- groups = { monster = 1 }, -- chance = yl_spawnit.base_chance / 0.1, -- on = { "group:soil", "group:stone" }, -- max_y = 5000, -- max_in_area = 1, -- max_any_in_area = 6, -- min_player_distance = 12, -- spawn_in_protected = false, -- should_spawn = function() -- return os.date("*t").month == 10 -- end, --}, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:panda", groups = { animal = 1 }, chance = yl_spawnit.base_chance, on = { "group:soil" }, near = { "ethereal:bamboo", "ethereal:bamboo_leaves", "ethereal:bamboo_sprout" }, min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:parrot", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.8, on = { "any" }, near = { "default:jungleleaves", "moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_red", "ethereal:palmleaves", "moretrees:date_palm_leaves", "moretrees:palm_leaves", }, min_y = 0, max_y = 5000, min_node_light = 10, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:penguin", groups = { animal = 1 }, chance = yl_spawnit.base_chance, on = { "default:snowblock", "default:ice" }, min_y = 0, max_y = 10, min_node_light = 12, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:pigeon", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6 * 2, on = { "any" }, min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:piggy", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6 * 3, cluster = 3, on = combine(grass, dry_grass, jungle), min_y = 0, max_y = 5000, max_in_area = 3, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:polar_bear", groups = { animal = 1, hostile = 1 }, chance = yl_spawnit.base_chance, on = { "default:snowblock", "default:ice", "default:dirt_with_snow", "default:snow" }, min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, min_player_distance = 12, spawn_in_protected = false, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:pony", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6 * 5, cluster = 5, on = combine(grass, dry_grass), min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 5, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:puppy", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6, on = combine(grass, dry_grass), min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:queen_ant", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.4, on = combine(grass, dry_grass, jungle), min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:queen_bee", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.4, on = { "any" }, near = { "group:flower" }, min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:rat", groups = { animal = 1, hostile = 1 }, chance = yl_spawnit.base_chance / 0.2 * 2, on = { "group:soil", "group:stone", "rainbow_source:black_water_source" }, max_y = 5000, max_node_light = 10, max_in_area = 1, max_any_in_area = 6, min_player_distance = 12, spawn_in_protected = false, }, yl_spawnit.settings.check_nodes) -- killer santa shouldn't spawn --spawnit.register({ -- entity_name = "petz:santa_killer", -- groups = { monster = 1 }, -- chance = yl_spawnit.base_chance / 0.1, -- on = { "default:snowblock", "default:ice", "default:dirt_with_snow", "default:snow" }, -- min_y = -32, -- max_y = 10, -- max_in_area = 1, -- max_any_in_area = 6, -- min_player_distance = 12, -- spawn_in_protected = false, -- should_spawn = function() -- return os.date("*t").month == 12 -- end, --}, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:silkworm", groups = { animal = 1 }, chance = yl_spawnit.base_chance * 3, on = { "default:acacia_bush_leaves", "default:acacia_leaves", "mahogany:leaves", "moretrees:apple_tree_leaves", "moretrees:beech_leaves", "moretrees:birch_leaves", "moretrees:cedar_leaves", "moretrees:date_palm_leaves", "moretrees:fir_leaves", "moretrees:fir_leaves_bright", "moretrees:jungletree_leaves_red", "moretrees:jungletree_leaves_yellow", "moretrees:oak_leaves", "moretrees:palm_leaves", "moretrees:poplar_leaves", "moretrees:rubber_tree_leaves", "moretrees:sequoia_leaves", "moretrees:spruce_leaves", "moretrees:willow_leaves", }, min_y = 0, max_y = 5000, max_in_area = 1, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:snow_leopard", groups = { animal = 1, hostile = 1 }, chance = yl_spawnit.base_chance, on = { "default:dirt_with_snow", "default:snow" }, min_y = 20, max_y = 5000, max_in_area = 1, max_any_in_area = 6, min_player_distance = 12, spawn_in_protected = false, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:squirrel", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.8 * 3, cluster = 3, on = { "group:leaves", "group:tree" }, min_y = 0, max_y = 5000, min_node_light = 8, max_in_area = 3, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:tarantula", groups = { animal = 1, hostile = 1 }, chance = yl_spawnit.base_chance * 10, on = { "group:stone", "default:dirt_with_rainforest_litter", "ethereal:jungle_dirt", "default:jungleleaves", "moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_red", "ethereal:palmleaves", "moretrees:date_palm_leaves", "moretrees:palm_leaves", }, max_y = 5000, max_in_area = 3, max_any_in_area = 6, min_player_distance = 12, spawn_in_protected = false, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:toucan", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.8, on = { "any" }, near = { "default:jungleleaves", "moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_red", "ethereal:palmleaves", "moretrees:date_palm_leaves", "moretrees:palm_leaves", }, min_y = 0, max_y = 5000, min_node_light = 12, max_in_area = 1, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:tropicalfish", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 25, within = { "default:water_source" }, on = { "any" }, near = { "group:coral" }, min_y = -100, max_y = 5000, min_node_light = 2, max_in_area = 2, max_any_in_area = 6, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:turtle", groups = { animal = 1 }, chance = yl_spawnit.base_chance / 0.6 * 2, within = { "group:water" }, on = { "any" }, min_y = -100, max_y = 5000, min_node_light = 8, max_in_area = 2, max_any_in_area = 6, min_time_of_day = yl_spawnit.dawn, max_time_of_day = yl_spawnit.dusk, spawn_in_protected = true, }, yl_spawnit.settings.check_nodes) spawnit.register({ entity_name = "petz:wolf", groups = { animal = 1, hostile = 1 }, chance = yl_spawnit.base_chance * 4, cluster = 4, on = combine(cold, grass), min_y = 0, max_y = 5000, max_in_area = 4, max_any_in_area = 6, min_player_distance = 12, spawn_in_protected = false, }, yl_spawnit.settings.check_nodes)