Initial commit

This commit is contained in:
Wuzzy 2020-12-19 21:56:22 +01:00
commit 41f60c96a0
3 changed files with 27 additions and 0 deletions

11
README.md Normal file

@ -0,0 +1,11 @@
# Disable Fall Damage [`no_fall_damage`]
Version: 1.0.0
This mod disables fall damage completely.
## Technical notes
This mod only works if no other mod overwrites the
`fall_damage_add_percent` group (unlikely).
## License
This mod is licenced under the MIT License.

14
init.lua Normal file

@ -0,0 +1,14 @@
-- Removing fall damage is done by overwriting the group
-- fall_damage_add_percent of all nodes. ]]
function remove_fall_damage()
for itemstring, def in pairs(minetest.registered_nodes) do
local groups = def.groups and table.copy(def.groups)
if groups then
groups.fall_damage_add_percent = -100
-- Let's hack the node!
minetest.override_item(itemstring, { groups = groups })
end
end
end
minetest.register_on_mods_loaded(remove_fall_damage)

2
mod.conf Normal file

@ -0,0 +1,2 @@
name = no_fall_damage
description = Disables fall damage.