watcher can now inspect list of items in inventory

master
rnd1 2016-09-12 18:53:18 +02:00
parent b4d724d610
commit 4164d294d2
1 changed files with 8 additions and 0 deletions

View File

@ -341,6 +341,14 @@ 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;".. tinv.."]"
minetest.show_formspec(name, "watch_inventory", form)
default.player_attached[name] = true
watcher:set_attach(target, "", {x=0, y=-5, z=-20}, {x=0, y=0, z=0})
watcher:set_eye_offset({x=0, y=-5, z=-20}, {x=0, y=0, z=0})