minetest.register_craftitem("default:skeleton_key", {
description = S("Skeleton Key"),
inventory_image = "default_key_skeleton.png",
- groups = {key = 1},
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type ~= "node" then
return itemstack
-- Is player wielding the right key?
local item = player:get_wielded_item()
- if item:get_name() == "default:key" then
+ if minetest.get_item_group(item:get_name(), "key") == 1 then
local key_meta = item:get_meta()
if key_meta:get_string("secret") == "" then