diff options
author | madmaxoft <github@xoft.cz> | 2013-07-28 16:01:56 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-07-28 16:01:56 +0200 |
commit | 64845e81b3047da1df896b2b4d38f6e119af0675 (patch) | |
tree | a6222a6b5e833d361905b134b46fe954510289ad | |
parent | Hunger-per-distance is calculated only for the XZ distance (diff) | |
download | cuberite-64845e81b3047da1df896b2b4d38f6e119af0675.tar cuberite-64845e81b3047da1df896b2b4d38f6e119af0675.tar.gz cuberite-64845e81b3047da1df896b2b4d38f6e119af0675.tar.bz2 cuberite-64845e81b3047da1df896b2b4d38f6e119af0675.tar.lz cuberite-64845e81b3047da1df896b2b4d38f6e119af0675.tar.xz cuberite-64845e81b3047da1df896b2b4d38f6e119af0675.tar.zst cuberite-64845e81b3047da1df896b2b4d38f6e119af0675.zip |
Diffstat (limited to '')
-rw-r--r-- | MCServer/Plugins/Debuggers/Debuggers.lua | 27 |
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
+
+
+
+
|