tbillion wrote:or have the block forceload itself at all times like the admin anchor. (technic) really just looking for the base code for that will move an item from one position to another. that way my tbm can move items from its inventory to another storage when its onboard inventory is full. your right about the formspec though. i figured a teleport chest system would be the simplest form of teleport. a simple solution is a simple example to follow.
afaik, you can manipulate node meta even when the block is not loaded, there should be no need to forceload anything. Here is a simple example. Create a flat map (for simplicity) and place a chest at 1000, 4, 1000 then teleport to 0, 4, 0 or wherever you like, go back to the chest a few minutes later and it should contain some apples ;-)
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
local timer = 0
local stack = "default:apple"
local metapos = {x=1000, y=4, z=1000}
minetest.register_globalstep(function(dtime)
timer = timer + dtime
if timer > 4 then
local meta = minetest.get_meta(metapos)
if meta then
local inv = meta:get_inventory()
if inv:room_for_item("main", stack) then
inv:add_item("main", stack)
end
end
timer = 0
end
end)
Note that you will see a server warning until you actually place a chest at the meta position.
Hope this gives you some ideas, sorry if I totally misunderstood the question.