forked from VoxeLibre/VoxeLibre
clearmobs command: nametagged/tamed is exclusive
This commit is contained in:
parent
a3e6f90b09
commit
150222583a
|
@ -538,7 +538,7 @@ end)
|
||||||
minetest.register_chatcommand("clearmobs", {
|
minetest.register_chatcommand("clearmobs", {
|
||||||
privs = { maphack = true },
|
privs = { maphack = true },
|
||||||
params = "[all|monster|passive|<mob name> [<range>|nametagged|tamed]]",
|
params = "[all|monster|passive|<mob name> [<range>|nametagged|tamed]]",
|
||||||
description = S("Removes specified mobs except nametagged and tamed ones. For the second parameter, use nametagged/tamed to include tamed or nametagged mobs, or a range to specify a maximum distance from the player."),
|
description = S("Removes specified mobs except nametagged and tamed ones. For the second parameter, use nametagged/tamed to select only nametagged/tamed mobs, or a range to specify a maximum distance from the player."),
|
||||||
func = function(player, param)
|
func = function(player, param)
|
||||||
local default = false
|
local default = false
|
||||||
if not param or param == "" then
|
if not param or param == "" then
|
||||||
|
@ -633,17 +633,17 @@ minetest.register_chatcommand("clearmobs", {
|
||||||
|
|
||||||
--minetest.log("o.nametag: ".. tostring(o.nametag))
|
--minetest.log("o.nametag: ".. tostring(o.nametag))
|
||||||
|
|
||||||
if nametagged and o.nametag then
|
if nametagged then
|
||||||
--minetest.log("Namedtagged and it has a name tag. Kill it")
|
if o.nametag then
|
||||||
o.object:remove()
|
--minetest.log("Namedtagged and it has a name tag. Kill it")
|
||||||
end
|
o.object:remove()
|
||||||
|
end
|
||||||
if tamed and o.tamed then
|
elseif tamed then
|
||||||
--minetest.log("Tamed. Kill it")
|
if o.tamed then
|
||||||
o.object:remove()
|
--minetest.log("Tamed. Kill it")
|
||||||
end
|
o.object:remove()
|
||||||
|
end
|
||||||
if in_range and (not o.nametag or o.nametag == "") and not o.tamed then
|
elseif in_range and (not o.nametag or o.nametag == "") and not o.tamed then
|
||||||
--minetest.log("No nametag or tamed. Kill it")
|
--minetest.log("No nametag or tamed. Kill it")
|
||||||
o.object:remove()
|
o.object:remove()
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,5 +9,5 @@ Before you use the name tag, you need to set a name at an anvil. Then you can us
|
||||||
Only peaceful mobs allowed!=
|
Only peaceful mobs allowed!=
|
||||||
Give names to mobs=
|
Give names to mobs=
|
||||||
Set name at anvil=
|
Set name at anvil=
|
||||||
Removes specified mobs except nametagged and tamed ones. For the second parameter, use nametagged/tamed to include tamed or nametagged mobs, or a range to specify a maximum distance from the player.=
|
Removes specified mobs except nametagged and tamed ones. For the second parameter, use nametagged/tamed to select only nametagged/tamed mobs, or a range to specify a maximum distance from the player.=
|
||||||
Default usage. Clearing hostile mobs. For more options please type: /help clearmobs=
|
Default usage. Clearing hostile mobs. For more options please type: /help clearmobs=
|
||||||
|
|
Loading…
Reference in New Issue