MineClone2/mods/MISC/mcl_basic_commands/setblock.lua

35 lines
989 B
Lua

local S = minetest.get_translator("mcl_commands")
mcl_commands.register_command("setblock", {
func = function(cmd)
cmd:sub(":pos:pos :node:nodename", {
func = function(name, pos, node)
minetest.set_node(pos, {name=node})
return true, S("@1 spawned.", node)
--return false, S("Invalid parameters (see /help setblock)")
end,
privs = {},
})
end,
description = S("Set node at given position"),
params = S("<X>,<Y>,<Z> <NodeString>"),
privs = {give=true, interact=true},
})
--DEBUG: must be removed later
mcl_commands.register_command("setdebug", {
func = function(cmd)
cmd:sub(":node:nodename", {
func = function(name, node)
minetest.set_node({x=0,y=0,z=0}, {name=node})
return true, S("@1 spawned.", node)
--return false, S("Invalid parameters (see /help setblock)")
end,
privs = {},
})
end,
description = S("Set node at given position"),
params = S("<X>,<Y>,<Z> <NodeString>"),
privs = {give=true, interact=true},
})