diff --git a/enchanting.lua b/enchanting.lua index 16e0eae..399d3b4 100644 --- a/enchanting.lua +++ b/enchanting.lua @@ -83,7 +83,7 @@ function enchanting.fields(pos, _, fields) local mese = inv:get_stack("mese", 1) local orig_wear = tool:get_wear() local mod, name = tool:get_name():match("(.*):(.*)") - local enchanted_tool = mod..":enchanted_"..name.."_"..next(fields) + local enchanted_tool = (mod or "")..":enchanted_"..(name or "").."_"..next(fields) if mese:get_count() >= mese_cost and minetest.registered_tools[enchanted_tool] then tool:replace(enchanted_tool)