added custom spawn check and examples
This commit is contained in:
parent
3a05a29b02
commit
85b633d3f6
@ -67,21 +67,6 @@ if croc_walkers then
|
|||||||
mobs:register_mob("mobs_crocs:crocodile", table.copy(croc_def))
|
mobs:register_mob("mobs_crocs:crocodile", table.copy(croc_def))
|
||||||
|
|
||||||
mobs:register_egg("mobs_crocs:crocodile", "Crocodile (walk)", "default_grass.png", 1)
|
mobs:register_egg("mobs_crocs:crocodile", "Crocodile (walk)", "default_grass.png", 1)
|
||||||
|
|
||||||
mobs:spawn({
|
|
||||||
name = "mobs_crocs:crocodile",
|
|
||||||
nodes = {
|
|
||||||
(mod_mcl and "group:shovely" or "group:crumbly")
|
|
||||||
},
|
|
||||||
neighbors = {
|
|
||||||
"group:water", "dryplants:juncus", "dryplants:reedmace",
|
|
||||||
(mod_mcl and "mcl_core:reeds" or "default:papyrus")
|
|
||||||
},
|
|
||||||
interval = 30,
|
|
||||||
chance = croc_spawn_chance,
|
|
||||||
min_height = 0,
|
|
||||||
max_height = 10
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -95,20 +80,6 @@ if croc_floaters then
|
|||||||
mobs:register_mob("mobs_crocs:crocodile_float", table.copy(croc_def))
|
mobs:register_mob("mobs_crocs:crocodile_float", table.copy(croc_def))
|
||||||
|
|
||||||
mobs:register_egg("mobs_crocs:crocodile_float", "Crocodile (float)", "default_grass.png", 1)
|
mobs:register_egg("mobs_crocs:crocodile_float", "Crocodile (float)", "default_grass.png", 1)
|
||||||
|
|
||||||
mobs:spawn({
|
|
||||||
name = "mobs_crocs:crocodile_float",
|
|
||||||
nodes = {"group:water"},
|
|
||||||
neighbors = {
|
|
||||||
(mcl_core and "group:shovely" or "group:crumbly"),
|
|
||||||
"group:seaplants", "dryplants:juncus", "dryplants:reedmace",
|
|
||||||
(mod_mcl and "mcl_core:reeds" or "default:papyrus")
|
|
||||||
},
|
|
||||||
interval = 30,
|
|
||||||
chance = croc_spawn_chance,
|
|
||||||
min_height = -3,
|
|
||||||
max_height = 10
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -125,17 +96,63 @@ if croc_swimmers then
|
|||||||
mobs:register_mob("mobs_crocs:crocodile_swim", table.copy(croc_def))
|
mobs:register_mob("mobs_crocs:crocodile_swim", table.copy(croc_def))
|
||||||
|
|
||||||
mobs:register_egg("mobs_crocs:crocodile_swim", "Crocodile (swim)", "default_grass.png", 1)
|
mobs:register_egg("mobs_crocs:crocodile_swim", "Crocodile (swim)", "default_grass.png", 1)
|
||||||
|
|
||||||
mobs:spawn({
|
|
||||||
name = "mobs_crocs:crocodile_swim",
|
|
||||||
nodes = {"group:water"},
|
|
||||||
neighbors = {(mcl_core and "group:shovely" or "group:crumbly")},
|
|
||||||
interval = 30,
|
|
||||||
chance = croc_spawn_chance,
|
|
||||||
min_height = -8,
|
|
||||||
max_height = 10
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Check for custom spawn.lua
|
||||||
|
|
||||||
|
local MP = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||||
|
local input = io.open(MP .. "spawn.lua", "r")
|
||||||
|
|
||||||
|
if input then
|
||||||
|
input:close() ; input = nil ; dofile(MP .. "spawn.lua")
|
||||||
|
else
|
||||||
|
if croc_walkers then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_crocs:crocodile",
|
||||||
|
nodes = {
|
||||||
|
(mod_mcl and "group:shovely" or "group:crumbly")
|
||||||
|
},
|
||||||
|
neighbors = {
|
||||||
|
"group:water", "dryplants:juncus", "dryplants:reedmace",
|
||||||
|
(mod_mcl and "mcl_core:reeds" or "default:papyrus")
|
||||||
|
},
|
||||||
|
interval = 30,
|
||||||
|
chance = croc_spawn_chance,
|
||||||
|
min_height = 0,
|
||||||
|
max_height = 10
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if croc_floaters then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_crocs:crocodile_float",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {
|
||||||
|
(mcl_core and "group:shovely" or "group:crumbly"),
|
||||||
|
"group:seaplants", "dryplants:juncus", "dryplants:reedmace",
|
||||||
|
(mod_mcl and "mcl_core:reeds" or "default:papyrus")
|
||||||
|
},
|
||||||
|
interval = 30,
|
||||||
|
chance = croc_spawn_chance,
|
||||||
|
min_height = -3,
|
||||||
|
max_height = 10
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if croc_swimmers then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_crocs:crocodile_swim",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {(mcl_core and "group:shovely" or "group:crumbly")},
|
||||||
|
interval = 30,
|
||||||
|
chance = croc_spawn_chance,
|
||||||
|
min_height = -8,
|
||||||
|
max_height = 10
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
print("[MOD] Mobs Redo Crocs loaded")
|
print("[MOD] Mobs Redo Crocs loaded")
|
||||||
|
52
mobs_crocs/spawn_example.lua
Normal file
52
mobs_crocs/spawn_example.lua
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
|
||||||
|
-- load settings
|
||||||
|
|
||||||
|
local croc_walkers = minetest.settings:get_bool("mobs_crocs.enable_walkers", true)
|
||||||
|
local croc_floaters = minetest.settings:get_bool("mobs_crocs.enable_floaters", true)
|
||||||
|
local croc_swimmers = minetest.settings:get_bool("mobs_crocs.enable_swimmers", true)
|
||||||
|
|
||||||
|
-- spawn examples
|
||||||
|
|
||||||
|
if croc_walkers then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_crocs:crocodile",
|
||||||
|
nodes = {"group:crumbly"},
|
||||||
|
neighbors = {
|
||||||
|
"group:water", "dryplants:juncus", "dryplants:reedmace", "default:papyrus"
|
||||||
|
},
|
||||||
|
interval = 30,
|
||||||
|
chance = 20000,
|
||||||
|
min_height = 0,
|
||||||
|
max_height = 10
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if croc_floaters then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_crocs:crocodile_float",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {
|
||||||
|
"group:crumbly", "group:seaplants", "dryplants:juncus",
|
||||||
|
"dryplants:reedmace", "default:papyrus"
|
||||||
|
},
|
||||||
|
interval = 30,
|
||||||
|
chance = 20000,
|
||||||
|
min_height = -3,
|
||||||
|
max_height = 10
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if croc_swimmers then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_crocs:crocodile_swim",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {"group:crumbly"},
|
||||||
|
interval = 30,
|
||||||
|
chance = 20000,
|
||||||
|
min_height = -8,
|
||||||
|
max_height = 10
|
||||||
|
})
|
||||||
|
end
|
@ -84,22 +84,6 @@ mobs:register_mob("mobs_fish:clownfish", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- spawn in world
|
|
||||||
|
|
||||||
mobs:spawn({
|
|
||||||
name = "mobs_fish:clownfish",
|
|
||||||
nodes = {"group:water"},
|
|
||||||
neighbors = {
|
|
||||||
(mod_mcl and "group:shovely" or "group:crumbly"),
|
|
||||||
"group:seaplants", "group:seacoral"
|
|
||||||
},
|
|
||||||
min_light = 5,
|
|
||||||
interval = 30,
|
|
||||||
chance = l_spawn_chance,
|
|
||||||
max_height = l_water_level,
|
|
||||||
active_object_count = 5
|
|
||||||
})
|
|
||||||
|
|
||||||
-- spawn egg
|
-- spawn egg
|
||||||
|
|
||||||
mobs:register_egg("mobs_fish:clownfish", "Clownfish", "animal_clownfish_clownfish_item.png", 0)
|
mobs:register_egg("mobs_fish:clownfish", "Clownfish", "animal_clownfish_clownfish_item.png", 0)
|
||||||
@ -156,27 +140,50 @@ mobs:register_mob("mobs_fish:tropical", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- spawn in world
|
|
||||||
|
|
||||||
mobs:spawn({
|
|
||||||
name = "mobs_fish:tropical",
|
|
||||||
nodes = {"group:water"},
|
|
||||||
neighbors = {
|
|
||||||
(mod_mcl and "group:shovely" or "group:crumbly"),
|
|
||||||
"group:seaplants", "group:seacoral"
|
|
||||||
},
|
|
||||||
min_light = 5,
|
|
||||||
interval = 30,
|
|
||||||
chance = l_spawn_chance,
|
|
||||||
max_height = l_water_level,
|
|
||||||
active_object_count = 5
|
|
||||||
})
|
|
||||||
|
|
||||||
-- spawn egg
|
-- spawn egg
|
||||||
|
|
||||||
mobs:register_egg("mobs_fish:tropical", "Tropical fish",
|
mobs:register_egg("mobs_fish:tropical", "Tropical fish",
|
||||||
"animal_fish_blue_white_fish_blue_white_item.png", 0)
|
"animal_fish_blue_white_fish_blue_white_item.png", 0)
|
||||||
|
|
||||||
|
-- Check for custom spawn.lua
|
||||||
|
|
||||||
|
local MP = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||||
|
local input = io.open(MP .. "spawn.lua", "r")
|
||||||
|
|
||||||
|
if input then
|
||||||
|
input:close() ; input = nil ; dofile(MP .. "spawn.lua")
|
||||||
|
else
|
||||||
|
-- clownfish
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_fish:clownfish",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {
|
||||||
|
(mod_mcl and "group:shovely" or "group:crumbly"),
|
||||||
|
"group:seaplants", "group:seacoral"
|
||||||
|
},
|
||||||
|
min_light = 5,
|
||||||
|
interval = 30,
|
||||||
|
chance = l_spawn_chance,
|
||||||
|
max_height = l_water_level,
|
||||||
|
active_object_count = 5
|
||||||
|
})
|
||||||
|
|
||||||
|
-- tropical fish
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_fish:tropical",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {
|
||||||
|
(mod_mcl and "group:shovely" or "group:crumbly"),
|
||||||
|
"group:seaplants", "group:seacoral"
|
||||||
|
},
|
||||||
|
min_light = 5,
|
||||||
|
interval = 30,
|
||||||
|
chance = l_spawn_chance,
|
||||||
|
max_height = l_water_level,
|
||||||
|
active_object_count = 5
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- helper function
|
-- helper function
|
||||||
|
|
||||||
local function add_food_group(item)
|
local function add_food_group(item)
|
||||||
|
24
mobs_fish/spawn_example.lua
Normal file
24
mobs_fish/spawn_example.lua
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
-- Fish spawn examples
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_fish:clownfish",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {"group:crumbly", "group:seaplants", "group:seacoral"},
|
||||||
|
min_light = 5,
|
||||||
|
interval = 30,
|
||||||
|
chance = 10000,
|
||||||
|
max_height = -1,
|
||||||
|
active_object_count = 5
|
||||||
|
})
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_fish:tropical",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {"group:crumbly", "group:seaplants", "group:seacoral"},
|
||||||
|
min_light = 5,
|
||||||
|
interval = 30,
|
||||||
|
chance = 10000,
|
||||||
|
max_height = -1,
|
||||||
|
active_object_count = 5
|
||||||
|
})
|
@ -37,17 +37,24 @@ mobs:register_mob("mobs_jellyfish:jellyfish", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- spawn in world
|
-- Check for custom spawn.lua
|
||||||
|
|
||||||
mobs:spawn({
|
local MP = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||||
name = "mobs_jellyfish:jellyfish",
|
local input = io.open(MP .. "spawn.lua", "r")
|
||||||
nodes = {(mod_mcl and "mcl_core:water_source" or "default:water_source")},
|
|
||||||
neighbors = {"group:water"},
|
if input then
|
||||||
min_light = 5,
|
input:close() ; input = nil ; dofile(MP .. "spawn.lua")
|
||||||
interval = 30,
|
else
|
||||||
chance = 10000,
|
mobs:spawn({
|
||||||
max_height = 0
|
name = "mobs_jellyfish:jellyfish",
|
||||||
})
|
nodes = {(mod_mcl and "mcl_core:water_source" or "default:water_source")},
|
||||||
|
neighbors = {"group:water"},
|
||||||
|
min_light = 5,
|
||||||
|
interval = 30,
|
||||||
|
chance = 10000,
|
||||||
|
max_height = 0
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- spawn egg
|
-- spawn egg
|
||||||
|
|
||||||
|
12
mobs_jellyfish/spawn_example.lua
Normal file
12
mobs_jellyfish/spawn_example.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
-- Jellyfish spawn example
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_jellyfish:jellyfish",
|
||||||
|
nodes = {"default:water_source"},
|
||||||
|
neighbors = {"group:water"},
|
||||||
|
min_light = 5,
|
||||||
|
interval = 30,
|
||||||
|
chance = 10000,
|
||||||
|
max_height = 0
|
||||||
|
})
|
@ -1,8 +0,0 @@
|
|||||||
|
|
||||||
-- SETTINGS
|
|
||||||
|
|
||||||
ENABLE_SHARK_LARGE = true
|
|
||||||
ENABLE_SHARK_MEDIUM = true
|
|
||||||
ENABLE_SHARK_SMALL = true
|
|
||||||
|
|
||||||
HELP_WITH_EXPERIMENT = false
|
|
@ -23,17 +23,19 @@ local l_spawn_chance = 60000
|
|||||||
|
|
||||||
-- load settings
|
-- load settings
|
||||||
|
|
||||||
dofile(minetest.get_modpath("mobs_sharks") .. "/SETTINGS.txt")
|
local ENABLE_LARGE = minetest.settings:get_bool("mobs_sharks.enable_large") ~= false
|
||||||
|
local ENABLE_MEDIUM = minetest.settings:get_bool("mobs_sharks.enable_medium") ~= false
|
||||||
|
local ENABLE_SMALL = minetest.settings:get_bool("mobs_sharks.enable_small") ~= false
|
||||||
|
|
||||||
if not ENABLE_SHARK_LARGE then
|
if not ENABLE_LARGE then
|
||||||
l_spawn_chance = l_spawn_chance - 20000
|
l_spawn_chance = l_spawn_chance - 20000
|
||||||
end
|
end
|
||||||
|
|
||||||
if not ENABLE_SHARK_MEDIUM then
|
if not ENABLE_MEDIUM then
|
||||||
l_spawn_chance = l_spawn_chance - 20000
|
l_spawn_chance = l_spawn_chance - 20000
|
||||||
end
|
end
|
||||||
|
|
||||||
if not ENABLE_SHARK_SMALL then
|
if not ENABLE_SMALL then
|
||||||
l_spawn_chance = l_spawn_chance - 20000
|
l_spawn_chance = l_spawn_chance - 20000
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -43,7 +45,7 @@ local mod_mcl = minetest.get_modpath("mcl_core")
|
|||||||
|
|
||||||
-- large
|
-- large
|
||||||
|
|
||||||
if ENABLE_SHARK_LARGE then
|
if ENABLE_LARGE then
|
||||||
|
|
||||||
mobs:register_mob("mobs_sharks:shark_lg", {
|
mobs:register_mob("mobs_sharks:shark_lg", {
|
||||||
type = "monster",
|
type = "monster",
|
||||||
@ -83,22 +85,13 @@ if ENABLE_SHARK_LARGE then
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:spawn({
|
|
||||||
name = "mobs_sharks:shark_lg",
|
|
||||||
nodes = {"group:water"},
|
|
||||||
neighbors = {"group:water", "seawrecks:woodship", "seawrecks:uboot"},
|
|
||||||
interval = 30,
|
|
||||||
chance = l_spawn_chance,
|
|
||||||
max_height = 0
|
|
||||||
})
|
|
||||||
|
|
||||||
mobs:register_egg("mobs_sharks:shark_lg", "Shark (large)",
|
mobs:register_egg("mobs_sharks:shark_lg", "Shark (large)",
|
||||||
"mob_shark_shark_item.png", 0)
|
"mob_shark_shark_item.png", 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- medium
|
-- medium
|
||||||
|
|
||||||
if ENABLE_SHARK_MEDIUM then
|
if ENABLE_MEDIUM then
|
||||||
|
|
||||||
mobs:register_mob("mobs_sharks:shark_md", {
|
mobs:register_mob("mobs_sharks:shark_md", {
|
||||||
type = "monster",
|
type = "monster",
|
||||||
@ -138,22 +131,13 @@ if ENABLE_SHARK_MEDIUM then
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:spawn({
|
|
||||||
name = "mobs_sharks:shark_md",
|
|
||||||
nodes = {"group:water"},
|
|
||||||
neighbors = {"group:water", "seawrecks:woodship", "seawrecks:uboot"},
|
|
||||||
interval = 30,
|
|
||||||
chance = l_spawn_chance,
|
|
||||||
max_height = 0
|
|
||||||
})
|
|
||||||
|
|
||||||
mobs:register_egg("mobs_sharks:shark_md", "Shark (medium)",
|
mobs:register_egg("mobs_sharks:shark_md", "Shark (medium)",
|
||||||
"mob_shark_shark_item.png", 0)
|
"mob_shark_shark_item.png", 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- small
|
-- small
|
||||||
|
|
||||||
if ENABLE_SHARK_SMALL then
|
if ENABLE_SMALL then
|
||||||
|
|
||||||
mobs:register_mob("mobs_sharks:shark_sm", {
|
mobs:register_mob("mobs_sharks:shark_sm", {
|
||||||
type = "monster",
|
type = "monster",
|
||||||
@ -193,18 +177,53 @@ if ENABLE_SHARK_SMALL then
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:spawn({
|
|
||||||
name = "mobs_sharks:shark_sm",
|
|
||||||
nodes = {"group:water"},
|
|
||||||
neighbors = {"group:water", "seawrecks:woodship", "seawrecks:uboot"},
|
|
||||||
interval = 30,
|
|
||||||
chance = l_spawn_chance,
|
|
||||||
max_height = 0
|
|
||||||
})
|
|
||||||
|
|
||||||
mobs:register_egg("mobs_sharks:shark_sm", "Shark (small)",
|
mobs:register_egg("mobs_sharks:shark_sm", "Shark (small)",
|
||||||
"mob_shark_shark_item.png", 0)
|
"mob_shark_shark_item.png", 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Check for custom spawn.lua
|
||||||
|
|
||||||
|
local MP = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||||
|
local input = io.open(MP .. "spawn.lua", "r")
|
||||||
|
|
||||||
|
if input then
|
||||||
|
input:close() ; input = nil ; dofile(MP .. "spawn.lua")
|
||||||
|
else
|
||||||
|
if ENABLE_SMALL then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_sharks:shark_sm",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {"group:water", "seawrecks:woodship", "seawrecks:uboot"},
|
||||||
|
interval = 30,
|
||||||
|
chance = l_spawn_chance,
|
||||||
|
max_height = 0
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if ENABLE_MEDIUM then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_sharks:shark_md",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {"group:water", "seawrecks:woodship", "seawrecks:uboot"},
|
||||||
|
interval = 30,
|
||||||
|
chance = l_spawn_chance,
|
||||||
|
max_height = 0
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if ENABLE_LARGE then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_sharks:shark_lg",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {"group:water", "seawrecks:woodship", "seawrecks:uboot"},
|
||||||
|
interval = 30,
|
||||||
|
chance = l_spawn_chance,
|
||||||
|
max_height = 0
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
print("[MOD] Mobs Redo Sharks loaded")
|
print("[MOD] Mobs Redo Sharks loaded")
|
||||||
|
3
mobs_sharks/settingtypes.txt
Executable file
3
mobs_sharks/settingtypes.txt
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
mobs_sharks.enable_large (Enable Large Sharks) bool true
|
||||||
|
mobs_sharks.enable_medium (Enable Medium Sharks) bool true
|
||||||
|
mobs_sharks.enable_small (Enable Small Sharks) bool true
|
44
mobs_sharks/spawn_example.lua
Normal file
44
mobs_sharks/spawn_example.lua
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
|
||||||
|
-- load settings
|
||||||
|
|
||||||
|
local ENABLE_LARGE = minetest.settings:get_bool("mobs_sharks.enable_large") ~= false
|
||||||
|
local ENABLE_MEDIUM = minetest.settings:get_bool("mobs_sharks.enable_medium") ~= false
|
||||||
|
local ENABLE_SMALL = minetest.settings:get_bool("mobs_sharks.enable_small") ~= false
|
||||||
|
|
||||||
|
-- Shark spawn examples
|
||||||
|
|
||||||
|
if ENABLE_SMALL then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_sharks:shark_sm",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {"group:water", "seawrecks:woodship", "seawrecks:uboot"},
|
||||||
|
interval = 30,
|
||||||
|
chance = 20000,
|
||||||
|
max_height = 0
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if ENABLE_MEDIUM then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_sharks:shark_md",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {"group:water", "seawrecks:woodship", "seawrecks:uboot"},
|
||||||
|
interval = 30,
|
||||||
|
chance = 20000,
|
||||||
|
max_height = 0
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if ENABLE_LARGE then
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_sharks:shark_lg",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {"group:water", "seawrecks:woodship", "seawrecks:uboot"},
|
||||||
|
interval = 30,
|
||||||
|
chance = 20000,
|
||||||
|
max_height = 0
|
||||||
|
})
|
||||||
|
end
|
@ -80,24 +80,6 @@ mobs:register_mob("mobs_turtles:turtle", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- spawn in world
|
|
||||||
|
|
||||||
mobs:spawn({
|
|
||||||
name = "mobs_turtles:turtle",
|
|
||||||
nodes = {(mod_mcl and "group:shovely" or "group:crumbly")},
|
|
||||||
neighbors = {
|
|
||||||
(mod_mcl and "groups:shovely" or "group:crumbly"),
|
|
||||||
(mod_mcl and "mcl_core:reeds" or "default:papyrus"),
|
|
||||||
(mod_mcl and "mcl_core:cactus" or "default:cactus"),
|
|
||||||
"dryplants:juncus", "dryplants:reedmace"
|
|
||||||
},
|
|
||||||
min_light = 5,
|
|
||||||
interval = 30,
|
|
||||||
chance = l_spawn_chance,
|
|
||||||
min_height = 1,
|
|
||||||
max_height = 10
|
|
||||||
})
|
|
||||||
|
|
||||||
-- spawn egg
|
-- spawn egg
|
||||||
|
|
||||||
mobs:register_egg("mobs_turtles:turtle", "Turtle", "default_grass.png", 1)
|
mobs:register_egg("mobs_turtles:turtle", "Turtle", "default_grass.png", 1)
|
||||||
@ -146,23 +128,47 @@ mobs:register_mob("mobs_turtles:seaturtle", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- spawn in world
|
|
||||||
|
|
||||||
mobs:spawn({
|
|
||||||
name = "mobs_turtles:seaturtle",
|
|
||||||
nodes = {"group:water"},
|
|
||||||
neighbors = {
|
|
||||||
"group:water", "group:seaplants", "seawrecks:woodship", "seawrecks:uboot"
|
|
||||||
},
|
|
||||||
min_light = 5,
|
|
||||||
interval = 30,
|
|
||||||
chance = l_spawn_chance,
|
|
||||||
max_height = 0
|
|
||||||
})
|
|
||||||
|
|
||||||
-- spawn egg
|
-- spawn egg
|
||||||
|
|
||||||
mobs:register_egg("mobs_turtles:seaturtle", "Sea Turtle", "default_water.png", 1)
|
mobs:register_egg("mobs_turtles:seaturtle", "Sea Turtle", "default_water.png", 1)
|
||||||
|
|
||||||
|
-- Check for custom spawn.lua
|
||||||
|
|
||||||
|
local MP = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||||
|
local input = io.open(MP .. "spawn.lua", "r")
|
||||||
|
|
||||||
|
if input then
|
||||||
|
input:close() ; input = nil ; dofile(MP .. "spawn.lua")
|
||||||
|
else
|
||||||
|
-- land turtle
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_turtles:turtle",
|
||||||
|
nodes = {(mod_mcl and "group:shovely" or "group:crumbly")},
|
||||||
|
neighbors = {
|
||||||
|
(mod_mcl and "groups:shovely" or "group:crumbly"),
|
||||||
|
(mod_mcl and "mcl_core:reeds" or "default:papyrus"),
|
||||||
|
(mod_mcl and "mcl_core:cactus" or "default:cactus"),
|
||||||
|
"dryplants:juncus", "dryplants:reedmace"
|
||||||
|
},
|
||||||
|
min_light = 5,
|
||||||
|
interval = 30,
|
||||||
|
chance = l_spawn_chance,
|
||||||
|
min_height = 1,
|
||||||
|
max_height = 10
|
||||||
|
})
|
||||||
|
|
||||||
|
-- sea turtle
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_turtles:seaturtle",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {
|
||||||
|
"group:water", "group:seaplants", "seawrecks:woodship", "seawrecks:uboot"
|
||||||
|
},
|
||||||
|
min_light = 5,
|
||||||
|
interval = 30,
|
||||||
|
chance = l_spawn_chance,
|
||||||
|
max_height = 0
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
print("[MOD] Mobs Redo Turtles loaded")
|
print("[MOD] Mobs Redo Turtles loaded")
|
||||||
|
30
mobs_turtles/spawn_example.lua
Normal file
30
mobs_turtles/spawn_example.lua
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
-- Turtle spawn examples
|
||||||
|
|
||||||
|
-- land turtle
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_turtles:turtle",
|
||||||
|
nodes = {"group:crumbly"},
|
||||||
|
neighbors = {
|
||||||
|
"group:crumbly", "default:papyrus", "default:cactus",
|
||||||
|
"dryplants:juncus", "dryplants:reedmace"
|
||||||
|
},
|
||||||
|
min_light = 5,
|
||||||
|
interval = 30,
|
||||||
|
chance = 30000,
|
||||||
|
min_height = 1,
|
||||||
|
max_height = 10
|
||||||
|
})
|
||||||
|
|
||||||
|
-- sea turtle
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_turtles:seaturtle",
|
||||||
|
nodes = {"group:water"},
|
||||||
|
neighbors = {
|
||||||
|
"group:water", "group:seaplants", "seawrecks:woodship", "seawrecks:uboot"
|
||||||
|
},
|
||||||
|
min_light = 5,
|
||||||
|
interval = 30,
|
||||||
|
chance = 30000,
|
||||||
|
max_height = 0
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user