From c89830c00e9ae5c869c971e7cd96c699dccf3034 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 20 Aug 2016 13:53:06 +0100 Subject: [PATCH] cycle through mobs --- staves.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/staves.lua b/staves.lua index 11f1619..4f5ed64 100644 --- a/staves.lua +++ b/staves.lua @@ -45,10 +45,16 @@ minetest.register_tool("vivarium:staff_stack", { -- this will be the wall staff local newpos = pointed_thing.ref:getpos() bomf(newpos,2 ) local luae = pointed_thing.ref:get_luaentity() - - luae.type="npc" - luae.attacks_monsters=true - luae.state="walk" + + if luae.type == "monster" then + luae.type="npc" + luae.attacks_monsters=true + luae.state="walk" + elseif luae.type == "npc" then + luae.type = "animal" + elseif luae.type == "animal" then + luae.type = "monster" + end end return end