mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-09 17:30:21 +01:00
add ability to follow group: items
This commit is contained in:
parent
0f1f3b4fb3
commit
34b06df758
12
api.lua
12
api.lua
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210318",
|
version = "20210323",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -251,9 +251,17 @@ local check_for = function(look_for, look_inside)
|
|||||||
for _, str in pairs(look_inside) do
|
for _, str in pairs(look_inside) do
|
||||||
|
|
||||||
if str == look_for then
|
if str == look_for then
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if str:find("group:") then
|
||||||
|
|
||||||
|
local group = str:split(":")[2]
|
||||||
|
|
||||||
|
if minetest.get_item_group(look_for, group) ~= 0 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
2
api.txt
2
api.txt
@ -76,7 +76,7 @@ functions needed for the mob to work properly which contains the following:
|
|||||||
'floats' when set to 1 mob will float in water, 0 has them sink.
|
'floats' when set to 1 mob will float in water, 0 has them sink.
|
||||||
'follow' mobs follow player when holding any of the items which appear
|
'follow' mobs follow player when holding any of the items which appear
|
||||||
on this table, the same items can be fed to a mob to tame or
|
on this table, the same items can be fed to a mob to tame or
|
||||||
breed e.g. {"farming:wheat", "default:apple"}
|
breed e.g. {"farming:wheat", "default:apple", "group:fish"}
|
||||||
|
|
||||||
'reach' is how far the mob can attack player when standing
|
'reach' is how far the mob can attack player when standing
|
||||||
nearby, default is 3 nodes.
|
nearby, default is 3 nodes.
|
||||||
|
Loading…
Reference in New Issue
Block a user