aboutsummaryrefslogtreecommitdiff
path: root/builtin/client/cheats/movement.lua
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/client/cheats/movement.lua')
-rw-r--r--builtin/client/cheats/movement.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/builtin/client/cheats/movement.lua b/builtin/client/cheats/movement.lua
new file mode 100644
index 000000000..bd9b995ad
--- /dev/null
+++ b/builtin/client/cheats/movement.lua
@@ -0,0 +1,14 @@
+-- autosneak
+
+local autosneak_was_enabled = false
+
+core.register_globalstep(function()
+ if core.settings:get_bool("autosneak") then
+ core.set_keypress("sneak", true)
+ autosneak_was_enabled = true
+ elseif autosneak_was_enabled then
+ autosneak_was_enabled = false
+ core.set_keypress("sneak", false)
+ end
+end)
+