diff --git a/petting/mobtamer.lua b/petting/mobtamer.lua index cf1d47c..edf95b1 100644 --- a/petting/mobtamer.lua +++ b/petting/mobtamer.lua @@ -23,7 +23,7 @@ minetest.register_tool("petting:mobtamer", { -- here get the mob to the left local inventory = user:get_inventory() - local eggname = '' + local eggname = nil for idx,x in pairs(inventory:get_list("main") ) do if x:get_name() == "petting:mobtamer" then break @@ -31,6 +31,15 @@ minetest.register_tool("petting:mobtamer", { eggname = x:get_name() end + if eggname == nil then + minetest.chat_send_player(user:get_player_name(), ".... what. Report Mob Tamer failure to DuCake with screenshot of your inventory.") + return + end + if eggname:sub(1,1) == ":" then + minetest.chat_send_player(user:get_player_name(), "Your monster is ill-defined. Please let DuCake know") + return + end + local luaobj = minetest.add_entity(pos,eggname ) local luae = luaobj:get_luaentity()