You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Put this into default/init.lua before loading the nodes.
minetest.nodedef_default.on_secondary_use = function(itemstack, user)
local pos = user:get_pos()
local dir = user:get_look_dir()
pos = {x=pos.x+(dir.x*2), y=pos.y+(dir.y*2)+1, z=pos.z+(dir.z*2)}
if minetest.get_node(pos).name ~= "air" then return end
local n_name = itemstack:get_name()
local obj = core.add_entity(pos, "__builtin:falling_node")
if obj then
obj:get_luaentity():set_node({name = n_name})
obj:setvelocity({x=dir.x*2, y=dir.y*2, z=dir.z*2})
end
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end
To do next:
respect protection
have a privilege or setting to turn of on servers
maybe a sound effect
edit:
pick up chests and furnaces with all metadata and inventory intact
See forum.
The text was updated successfully, but these errors were encountered: