From 3c2519294487353e75c3d649adf1636bcf122e40 Mon Sep 17 00:00:00 2001 From: trans_soup <> Date: Fri, 13 Oct 2023 08:30:16 +0200 Subject: [PATCH] increase player step height. --- mods/bg_player/init.lua | 1 + mods/bg_player/step_height.lua | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 mods/bg_player/step_height.lua diff --git a/mods/bg_player/init.lua b/mods/bg_player/init.lua index 1af3873..de66f03 100644 --- a/mods/bg_player/init.lua +++ b/mods/bg_player/init.lua @@ -1,2 +1,3 @@ load_file("hand") load_file("run") +load_file("step_height") diff --git a/mods/bg_player/step_height.lua b/mods/bg_player/step_height.lua new file mode 100644 index 0000000..54f643f --- /dev/null +++ b/mods/bg_player/step_height.lua @@ -0,0 +1,8 @@ +minetest.register_globalstep(function(delta_time) + for _, player in pairs(minetest.get_connected_players()) do + local control = player:get_player_control() + local properties = player:get_properties() + properties.stepheight = control.sneak and 0.01 or 1.05 + player:set_properties(properties) + end +end)