core.register_node("creativetrophy:creativetrophy", {
	description = "Very Expensive Trophy (right-click to turn creative mode on/off)",
	drawtype = "mesh",
	mesh = "homedecor_trophy.obj",
	tiles = {
		"default_aspen_wood.png",
		"homedecor_generic_metal_gold.png"
	},
	inventory_image = "homedecor_trophy_inv.png",
	groups = { snappy=3 },
	walkable = false,
	selection_box = {
		type = "fixed",
		fixed = { -0.3125,-0.5,-0.1875,0.3125,0.125,0.1875},
	},
	after_place_node = function(pos,player)
		local name = player:get_player_name()
		local meta = core.get_meta(pos)
		local infotext = "Very Expensive Trophy\nOwned by: %s\nRight-click to turn creative mode on/off"
		meta:set_string("owner",name)
		meta:set_string("infotext",string.format(infotext,name))
	end,
	on_rightclick = function(pos,_,player)
		local name = player:get_player_name()
		local meta = core.get_meta(pos)
		if meta:get_string("owner") ~= name then
			core.chat_send_player(name,"This isn't yours!")
			return
		end
		local privs = core.get_player_privs(name)
		if privs.creative then
			privs.creative = nil
			core.chat_send_player(name,"You are now playing in survival mode.")
		else
			privs.creative = true
			core.chat_send_player(name,"You are now playing in creative mode.")
		end
		core.set_player_privs(name,privs)
	end,
})
