aboutsummaryrefslogtreecommitdiff
path: root/src/main/commands.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/commands.lua')
-rwxr-xr-xsrc/main/commands.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/commands.lua b/src/main/commands.lua
index 892df8f..473738a 100755
--- a/src/main/commands.lua
+++ b/src/main/commands.lua
@@ -14,7 +14,6 @@ minetest.register_chatcommand("message", {
})
minetest.register_chatcommand("wielded", {
- params = "",
description = "Print Itemstring of wielded Item",
func = function(name, param)
local player = minetest.get_player_by_name(name)
@@ -54,3 +53,16 @@ minetest.register_chatcommand("sudo", {
end
end
})
+
+minetest.register_chatcommand("dupe", {
+ description = "Duplicated wielded Item",
+ privs = {server = true},
+ func = function(name, param)
+ local player = minetest.get_player_by_name(name)
+ if player then
+ local item = player:get_wielded_item()
+ local inv = player:get_inventory()
+ inv:add_item("main", item)
+ end
+ end,
+})