show inventory

master
Juraj Vajda 2018-01-02 00:36:57 -05:00
parent a710669117
commit 8fd5ef65d9
1 changed files with 7 additions and 0 deletions

View File

@ -591,6 +591,13 @@ minetest.register_chatcommand("watch", {
original_pos[watcher] = watcher:getpos()
end
-- show inventory
local tinv = target:get_inventory():get_list("main");
for i,v in pairs(tinv) do tinv[i] = v:to_string(); end
tinv = dump(tinv);
local form = "size [6,7] textarea[0,0;6.5,8.5;creport;INVENTORY LIST;".. minetest.formspec_escape(tinv).."]"
minetest.show_formspec(name, "watch_inventory", form)
default.player_attached[name] = true
watcher:set_attach(target, "", vector.new(0, -5, -20), vector.new())
watcher:set_eye_offset(vector.new(0, -5, -20), vector.new())