Oh nvm I figured out what was wrong.
I needed to do it like this
Code: Select all
minetest.register_on_joinplayer(function(player)
local inv = player:get_inventory()
inv:set_size("rings", 2)
end)
sfinv.register_page("rings:ring_page", {
title = "Rings",
get = function(self, player, context)
local formspec = ""..
"list[current_player;rings;1.75,0.5;1,2;]"..
""..
"image[0,4.7;1,1;gui_hb_bg.png]"..
"image[1,4.7;1,1;gui_hb_bg.png]"..
"image[2,4.7;1,1;gui_hb_bg.png]"..
"image[3,4.7;1,1;gui_hb_bg.png]"..
"image[4,4.7;1,1;gui_hb_bg.png]"..
"image[5,4.7;1,1;gui_hb_bg.png]"..
"image[6,4.7;1,1;gui_hb_bg.png]"..
"image[7,4.7;1,1;gui_hb_bg.png]"
return sfinv.make_formspec(player, context, formspec, true)
end
})
But still can't figure out how to limit it to only items with "ring" group