summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-07-29 09:57:34 +0200
committermadmaxoft <github@xoft.cz>2013-07-29 09:57:34 +0200
commit5530178aad3fa1a3061962d47d77b627ab5ceae3 (patch)
tree61ee7896061b4ef92877c120d9f5e917a6c5c924 /MCServer/Plugins
parentMerge pull request #15 from mc-server/webadmin (diff)
parentUpdated the automatic Lua bindings (diff)
downloadcuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar.gz
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar.bz2
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar.lz
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar.xz
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar.zst
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index e2523e63e..1bc625c35 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -33,6 +33,8 @@ function Initialize(Plugin)
PluginManager:BindCommand("/dash", "debuggers", HandleDashCmd, "Switches between fast and normal sprinting speed");
PluginManager:BindCommand("/hunger", "debuggers", HandleHungerCmd, "Lists the current hunger-related variables");
PluginManager:BindCommand("/poison", "debuggers", HandlePoisonCmd, "Sets food-poisoning for 15 seconds");
+ PluginManager:BindCommand("/starve", "debuggers", HandleStarveCmd, "Sets the food level to zero");
+ PluginManager:BindCommand("/fl", "debuggers", HandleFoodLevelCmd, "Sets the food level to the given value");
-- Enable the following line for BlockArea / Generator interface testing:
-- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED);
@@ -715,3 +717,28 @@ end
+
+function HandleStarveCmd(a_Split, a_Player)
+ a_Player:SetFoodLevel(0);
+ a_Player:SendMessage("You are now starving");
+ return true;
+end
+
+
+
+
+
+function HandleFoodLevelCmd(a_Split, a_Player)
+ if (#a_Split ~= 2) then
+ a_Player:SendMessage("Missing an argument: the food level to set");
+ return true;
+ end
+
+ a_Player:SetFoodLevel(tonumber(a_Split[2]));
+ a_Player:SendMessage("Food level set to " .. a_Player:GetFoodLevel());
+ return true;
+end
+
+
+
+