forked from mtcontrib/mobs_redo
added mob_spawn_amend settings for minetest.conf
This commit is contained in:
parent
a0d975510e
commit
e5baaa5e13
5
api.lua
5
api.lua
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
mobs.version = "20171222"
|
mobs.version = "20171230"
|
||||||
|
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
@ -61,6 +61,7 @@ local remove_far = minetest.settings:get_bool("remove_far_mobs")
|
|||||||
local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0
|
local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0
|
||||||
local show_health = minetest.settings:get_bool("mob_show_health") ~= false
|
local show_health = minetest.settings:get_bool("mob_show_health") ~= false
|
||||||
local max_per_block = tonumber(minetest.settings:get("max_objects_per_block") or 99)
|
local max_per_block = tonumber(minetest.settings:get("max_objects_per_block") or 99)
|
||||||
|
local mob_spawn_amend = tonumber(minetest.settings:get("mob_spawn_amend") or 1)
|
||||||
|
|
||||||
-- Peaceful mode message so players will know there are no monsters
|
-- Peaceful mode message so players will know there are no monsters
|
||||||
if peaceful_only then
|
if peaceful_only then
|
||||||
@ -2834,7 +2835,7 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
|
|||||||
nodenames = nodes,
|
nodenames = nodes,
|
||||||
neighbors = neighbors,
|
neighbors = neighbors,
|
||||||
interval = interval,
|
interval = interval,
|
||||||
chance = chance,
|
chance = (chance * mob_spawn_amend),
|
||||||
catch_up = false,
|
catch_up = false,
|
||||||
|
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
3
api.txt
3
api.txt
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
MOB API (18th October 2017)
|
MOB API
|
||||||
|
|
||||||
The mob api is a function that can be called on by other mods to add new animals or monsters into minetest.
|
The mob api is a function that can be called on by other mods to add new animals or monsters into minetest.
|
||||||
|
|
||||||
@ -13,6 +13,7 @@ The mob api is a function that can be called on by other mods to add new animals
|
|||||||
'mobname' can change specific mob chance rate (0 to disable) and spawn number e.g. mobs_animal:cow = 1000,5
|
'mobname' can change specific mob chance rate (0 to disable) and spawn number e.g. mobs_animal:cow = 1000,5
|
||||||
'mob_difficulty' sets difficulty level (health and hit damage multiplied by this number), defaults to 1.0.
|
'mob_difficulty' sets difficulty level (health and hit damage multiplied by this number), defaults to 1.0.
|
||||||
'mob_show_health' if false then punching mob will not show health status (true by default)
|
'mob_show_health' if false then punching mob will not show health status (true by default)
|
||||||
|
'mob_spawn_amend' defaults to 1.0 but can be set to 0.5 to half ALL spawn rates or 2.0 to double.
|
||||||
|
|
||||||
mobs:register_mob(name, definition)
|
mobs:register_mob(name, definition)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Mobs Redo API (last updated 18th Oct 2017)
|
Mobs Redo API
|
||||||
==========================================
|
=============
|
||||||
|
|
||||||
Welcome to the world of mobs in minetest and hopefully an easy guide to defining
|
Welcome to the world of mobs in minetest and hopefully an easy guide to defining
|
||||||
your own mobs and having them appear in your worlds.
|
your own mobs and having them appear in your worlds.
|
||||||
@ -546,6 +546,8 @@ External Settings for "minetest.conf"
|
|||||||
multiplied by this number), defaults to 1.0.
|
multiplied by this number), defaults to 1.0.
|
||||||
'mob_show_health' if false then punching mob will not show health status
|
'mob_show_health' if false then punching mob will not show health status
|
||||||
(true by default)
|
(true by default)
|
||||||
|
'mob_spawn_amend' defaults to 1.0 but can be set to 0.5 to half ALL spawn
|
||||||
|
rates or 2.0 to double.
|
||||||
|
|
||||||
Players can override the spawn chance for each mob registered by adding a line
|
Players can override the spawn chance for each mob registered by adding a line
|
||||||
to their minetest.conf file with a new value, the lower the value the more each
|
to their minetest.conf file with a new value, the lower the value the more each
|
||||||
|
Loading…
Reference in New Issue
Block a user