Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Illuna-Minetest
mobs_monster
Commits
4018a5c8
Commit
4018a5c8
authored
Sep 21, 2020
by
tenplus1
Browse files
Added spawn.lua check for custom mob spawns, example file included
parent
144c8512
Changes
11
Hide whitespace changes
Inline
Side-by-side
dirt_monster.lua
View file @
4018a5c8
...
...
@@ -57,6 +57,7 @@ if minetest.get_modpath("ethereal") then
spawn_on
=
"ethereal:gray_dirt"
end
if
not
mobs
.
custom_spawn_monster
then
mobs
:
spawn
({
name
=
"mobs_monster:dirt_monster"
,
nodes
=
{
spawn_on
},
...
...
@@ -67,6 +68,7 @@ mobs:spawn({
min_height
=
0
,
day_toggle
=
false
,
})
end
mobs
:
register_egg
(
"mobs_monster:dirt_monster"
,
S
(
"Dirt Monster"
),
"default_dirt.png"
,
1
)
...
...
dungeon_master.lua
View file @
4018a5c8
...
...
@@ -62,6 +62,7 @@ mobs:register_mob("mobs_monster:dungeon_master", {
})
if
not
mobs
.
custom_spawn_monster
then
mobs
:
spawn
({
name
=
"mobs_monster:dungeon_master"
,
nodes
=
{
"default:stone"
},
...
...
@@ -70,6 +71,7 @@ mobs:spawn({
active_object_count
=
1
,
max_height
=
-
70
,
})
end
mobs
:
register_egg
(
"mobs_monster:dungeon_master"
,
S
(
"Dungeon Master"
),
"fire_basic_flame.png"
,
1
,
true
)
...
...
init.lua
View file @
4018a5c8
-- Load support for intllib.
local
path
=
minetest
.
get_modpath
(
minetest
.
get_current_modname
())
local
path
=
minetest
.
get_modpath
(
minetest
.
get_current_modname
())
..
"/"
local
S
=
minetest
.
get_translator
and
minetest
.
get_translator
(
"mobs_monster"
)
or
dofile
(
path
..
"/intllib.lua"
)
dofile
(
path
..
"intllib.lua"
)
mobs
.
intllib
=
S
-- Check for custom mob spawn file
local
input
=
io.open
(
path
..
"spawn.lua"
,
"r"
)
if
input
then
mobs
.
custom_spawn_monster
=
true
input
:
close
()
input
=
nil
end
-- Monsters
dofile
(
path
..
"/dirt_monster.lua"
)
-- PilzAdam
dofile
(
path
..
"/dungeon_master.lua"
)
dofile
(
path
..
"/oerkki.lua"
)
dofile
(
path
..
"/sand_monster.lua"
)
dofile
(
path
..
"/stone_monster.lua"
)
dofile
(
path
..
"/tree_monster.lua"
)
dofile
(
path
..
"/lava_flan.lua"
)
-- Zeg9
dofile
(
path
..
"/mese_monster.lua"
)
dofile
(
path
..
"/spider.lua"
)
-- AspireMint
dofile
(
path
..
"dirt_monster.lua"
)
-- PilzAdam
dofile
(
path
..
"dungeon_master.lua"
)
dofile
(
path
..
"oerkki.lua"
)
dofile
(
path
..
"sand_monster.lua"
)
dofile
(
path
..
"stone_monster.lua"
)
dofile
(
path
..
"tree_monster.lua"
)
dofile
(
path
..
"lava_flan.lua"
)
-- Zeg9
dofile
(
path
..
"mese_monster.lua"
)
dofile
(
path
..
"spider.lua"
)
-- AspireMint
-- Load custom spawning
if
mobs
.
custom_spawn_monster
then
dofile
(
path
..
"spawn.lua"
)
end
-- Lucky Blocks
dofile
(
path
..
"/lucky_block.lua"
)
dofile
(
path
..
"lucky_block.lua"
)
print
(
S
(
"[MOD] Mobs Redo Monsters loaded"
))
lava_flan.lua
View file @
4018a5c8
...
...
@@ -89,6 +89,7 @@ mobs:register_mob("mobs_monster:lava_flan", {
})
if
not
mobs
.
custom_spawn_monster
then
mobs
:
spawn
({
name
=
"mobs_monster:lava_flan"
,
nodes
=
{
"default:lava_source"
},
...
...
@@ -96,6 +97,7 @@ mobs:spawn({
active_object_count
=
1
,
max_height
=
0
,
})
end
mobs
:
register_egg
(
"mobs_monster:lava_flan"
,
S
(
"Lava Flan"
),
"default_lava.png"
,
1
)
...
...
mese_monster.lua
View file @
4018a5c8
...
...
@@ -56,6 +56,7 @@ mobs:register_mob("mobs_monster:mese_monster", {
})
if
not
mobs
.
custom_spawn_monster
then
mobs
:
spawn
({
name
=
"mobs_monster:mese_monster"
,
nodes
=
{
"default:stone"
},
...
...
@@ -64,6 +65,7 @@ mobs:spawn({
active_object_count
=
1
,
max_height
=
-
20
,
})
end
mobs
:
register_egg
(
"mobs_monster:mese_monster"
,
S
(
"Mese Monster"
),
"default_mese_block.png"
,
1
)
...
...
oerkki.lua
View file @
4018a5c8
...
...
@@ -60,6 +60,7 @@ mobs:register_mob("mobs_monster:oerkki", {
})
if
not
mobs
.
custom_spawn_monster
then
mobs
:
spawn
({
name
=
"mobs_monster:oerkki"
,
nodes
=
{
"default:stone"
},
...
...
@@ -67,6 +68,7 @@ mobs:spawn({
chance
=
7000
,
max_height
=
-
10
,
})
end
mobs
:
register_egg
(
"mobs_monster:oerkki"
,
S
(
"Oerkki"
),
"default_obsidian.png"
,
1
)
...
...
sand_monster.lua
View file @
4018a5c8
...
...
@@ -116,7 +116,7 @@ mobs:register_mob("mobs_monster:sand_monster", {
]]
})
if
not
mobs
.
custom_spawn_monster
then
mobs
:
spawn
({
name
=
"mobs_monster:sand_monster"
,
nodes
=
{
"default:desert_sand"
},
...
...
@@ -124,6 +124,7 @@ mobs:spawn({
active_object_count
=
2
,
min_height
=
0
,
})
end
mobs
:
register_egg
(
"mobs_monster:sand_monster"
,
S
(
"Sand Monster"
),
"default_desert_sand.png"
,
1
)
...
...
spawn_example.lua
0 → 100644
View file @
4018a5c8
--[[ Spawn Template, defaults to values shown if line not provided
mobs:spawn({
name = "",
- Name of mob, must be provided e.g. "mymod:my_mob"
nodes = {"group:soil, "group:stone"},
- Nodes to spawn on top of.
neighbors = {"air"},
- Nodes to spawn beside.
min_light = 0,
- Minimum light level.
max_light = 15,
- Maximum light level, 15 is sunlight only.
interval = 30,
- Spawn interval in seconds.
chance = 5000,
- Spawn chance, 1 in every 5000 nodes.
active_object_count = 1,
- Active mobs of this type in area.
min_height = -31000,
- Minimum height level.
max_height = 31000,
- Maximum height level.
day_toggle = nil,
- Daytime toggle, true to spawn during day, false for night, nil for both
on_spawn = nil,
- On spawn function to run when mob spawns in world
on_map_load = nil,
- On map load, when true mob only spawns in newly generated map areas
})
]]
--
-- Dirt Monster
mobs
:
spawn
({
name
=
"mobs_monster:dirt_monster"
,
nodes
=
{
"default:dirt_with_grass"
},
min_light
=
0
,
max_light
=
7
,
chance
=
6000
,
active_object_count
=
2
,
min_height
=
0
,
day_toggle
=
false
,
})
-- Dungeon Master
mobs
:
spawn
({
name
=
"mobs_monster:dungeon_master"
,
nodes
=
{
"default:stone"
},
max_light
=
5
,
chance
=
9000
,
active_object_count
=
1
,
max_height
=
-
70
,
})
-- Lava Flan
mobs
:
spawn
({
name
=
"mobs_monster:lava_flan"
,
nodes
=
{
"default:lava_source"
},
chance
=
1500
,
active_object_count
=
1
,
max_height
=
0
,
})
-- Mese Monster
mobs
:
spawn
({
name
=
"mobs_monster:mese_monster"
,
nodes
=
{
"default:stone"
},
max_light
=
7
,
chance
=
5000
,
active_object_count
=
1
,
max_height
=
-
20
,
})
-- Oerkki
mobs
:
spawn
({
name
=
"mobs_monster:oerkki"
,
nodes
=
{
"default:stone"
},
max_light
=
7
,
chance
=
7000
,
max_height
=
-
10
,
})
-- Sand Monster
mobs
:
spawn
({
name
=
"mobs_monster:sand_monster"
,
nodes
=
{
"default:desert_sand"
},
chance
=
7000
,
active_object_count
=
2
,
min_height
=
0
,
})
-- Spider (above ground)
mobs
:
spawn
({
name
=
"mobs_monster:spider"
,
nodes
=
{
"default:dirt_with_rainforest_litter"
,
"default:snowblock"
,
"default:snow"
,
"ethereal:crystal_dirt"
,
"ethereal:cold_dirt"
},
min_light
=
0
,
max_light
=
8
,
chance
=
7000
,
active_object_count
=
1
,
min_height
=
25
,
max_height
=
31000
,
})
-- Spider (below ground)
mobs
:
spawn
({
name
=
"mobs_monster:spider"
,
nodes
=
{
"default:stone_with_mese"
,
"default:mese"
,
"default:stone"
},
min_light
=
0
,
max_light
=
7
,
chance
=
7000
,
active_object_count
=
1
,
min_height
=
-
31000
,
max_height
=
-
40
,
})
-- Stone Monster
mobs
:
spawn
({
name
=
"mobs_monster:stone_monster"
,
nodes
=
{
"default:stone"
,
"default:desert_stone"
,
"default:sandstone"
},
max_light
=
7
,
chance
=
7000
,
max_height
=
0
,
})
-- Tree Monster
mobs
:
spawn
({
name
=
"mobs_monster:tree_monster"
,
nodes
=
{
"default:leaves"
,
"default:jungleleaves"
},
max_light
=
7
,
chance
=
7000
,
min_height
=
0
,
day_toggle
=
false
,
})
spider.lua
View file @
4018a5c8
...
...
@@ -178,6 +178,7 @@ mobs:register_mob("mobs_monster:spider", {
})
if
not
mobs
.
custom_spawn_monster
then
-- above ground spawn
mobs
:
spawn
({
name
=
"mobs_monster:spider"
,
...
...
@@ -204,6 +205,7 @@ mobs:spawn({
min_height
=
-
31000
,
max_height
=
-
40
,
})
end
mobs
:
register_egg
(
"mobs_monster:spider"
,
S
(
"Spider"
),
"mobs_cobweb.png"
,
1
)
...
...
stone_monster.lua
View file @
4018a5c8
...
...
@@ -62,6 +62,7 @@ mobs:register_mob("mobs_monster:stone_monster", {
})
if
not
mobs
.
custom_spawn_monster
then
mobs
:
spawn
({
name
=
"mobs_monster:stone_monster"
,
nodes
=
{
"default:stone"
,
"default:desert_stone"
,
"default:sandstone"
},
...
...
@@ -69,6 +70,7 @@ mobs:spawn({
chance
=
7000
,
max_height
=
0
,
})
end
mobs
:
register_egg
(
"mobs_monster:stone_monster"
,
S
(
"Stone Monster"
),
"default_stone.png"
,
1
)
...
...
tree_monster.lua
View file @
4018a5c8
...
...
@@ -67,6 +67,7 @@ mobs:register_mob("mobs_monster:tree_monster", {
})
if
not
mobs
.
custom_spawn_monster
then
mobs
:
spawn
({
name
=
"mobs_monster:tree_monster"
,
nodes
=
{
"default:leaves"
,
"default:jungleleaves"
},
...
...
@@ -75,6 +76,7 @@ mobs:spawn({
min_height
=
0
,
day_toggle
=
false
,
})
end
mobs
:
register_egg
(
"mobs_monster:tree_monster"
,
S
(
"Tree Monster"
),
"default_tree_top.png"
,
1
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment