Viewing an inventory from another node
I've been trying to figure out how to get this one to work. I am trying to show another nodes inventory through another node's formspec. I get it to retrieve the inventory properly but I'm not sure how to set its size to display the grid.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"list[nodemeta:"..meta:get_int("x")..","..meta:get_int("y")..","..meta:get_int("z")..";source;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Stockpile")
--I'm not sure which list I'm supposed to set to get this to work
end,