1 core.register_chatcommand("place", {
2 params = "<X>,<Y>,<Z>",
3 description = "Place wielded item",
5 local success, pos = core.parse_pos(param)
8 return true, "Node placed at " .. core.pos_to_string(pos)
14 core.register_chatcommand("dig", {
15 params = "<X>,<Y>,<Z>",
16 description = "Dig node",
17 func = function(param)
18 local success, pos = core.parse_pos(param)
21 return true, "Node at " .. core.pos_to_string(pos) .. " dug"
27 core.register_chatcommand("kill", {
28 description = "Kill yourself",
29 func = function(param)
30 core.send_damage(core.localplayer:get_hp())
34 core.register_chatcommand("scan", {
35 description = "Scan for one or multible nodes in a radius around you",
36 param = "<radius> node1[,node2...]",
37 func = function(param)
38 local radius = tonumber(param:split(" ")[1])
39 local nodes = param:split(" ")[2]:split(",")
40 local pos = core.localplayer:get_pos()
41 local fpos = core.find_node_near(pos, radius, nodes, true)
43 return true, "Found " .. table.concat(nodes, " or ") .. " at " .. core.pos_to_string(fpos)
45 return false, "None of " .. table.concat(nodes, " or ") .. " found in a radius of " .. tostring(radius)
49 local function teleport(param)
50 local success, pos = core.parse_pos(param)
52 core.localplayer:set_pos(pos)
53 return true, "Teleporting to " .. core.pos_to_string(pos)
58 core.register_chatcommand("teleport", {
59 params = "<X>,<Y>,<Z>",
60 description = "Teleport to position",
61 func = function(param)
62 return teleport(param)
66 core.register_chatcommand("tpoff", {
67 params = "<X>,<Y>,<Z>",
68 description = "Teleport to position and log out immediately",
69 func = function(param)
75 minetest.register_chatcommand("wielded", {
76 description = "Print itemstring of wieleded item",
78 return true, minetest.get_wielded_item():get_name()