Skip to content

About

Realistic fall damage when landing in water - lightweight Paper/Folia plugin for Minecraft 1.21.1

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

WaterFallDamage

Lightweight Paper/Folia plugin (Minecraft 1.21.11) that applies realistic fall damage when players land on anything vanilla uses to negate a fall.

Vanilla Minecraft lets water, cobwebs, scaffolding, hay bales, honey blocks, slime blocks, powder snow and sweet berry bushes fully negate fall distance - dropping 100 blocks into an ocean costs you nothing, and a single cobweb or scaffolding tower catches you from any height. WaterFallDamage changes exactly that, with one simple rule:

Fall 15 blocks or more onto a fall-negating surface and you take fall damage as if you had hit the ground. Falls under 15 blocks are absorbed exactly like vanilla.

Water is just the first entry in the configurable surface list; cobwebs, scaffolding and the rest behave identically.

Works on Paper, Purpur and Folia (built against paper-api 1.21.11, folia-supported: true).


Why it needs custom fall tracking

Vanilla never fires an EntityDamageEvent (cause FALL) for a soft landing, because the server zeroes the player's fallDistance the instant their feet touch the surface - that is the vanilla negation. Listening for the damage event or reading player.getFallDistance() at the moment of entry is a race against that reset.

So the plugin tracks every fall itself, inside PlayerMoveEvent:

  1. While a player is airborne, it remembers the highest Y reached (the apex of the fall).
  2. The moment the feet contact a fall-negating block (inside it, or standing on top of it), it computes fallen = apex - entryY - a deterministic fall distance that vanilla can no longer erase.
  3. If fallen >= 15.0, damage is applied via player.damage(amount, DamageCause.FALL).

Because the damage uses DamageCause.FALL, everything vanilla keeps working: Feather Falling, Protection and Resistance reduce it, totems can save the player, and other plugins (WorldGuard, etc.) can see or cancel it.

Folia compliance

Folia runs each world region on its own thread; touching entities or blocks from the wrong thread throws. This plugin follows the rules strictly:

Concern Solution
Movement detection PlayerMoveEvent is fired by Folia on the region thread that owns the player; the handler only touches that player and blocks at its own move coordinates
Shared tracker state ConcurrentHashMap (a roaming player's events arrive from different region threads over time)
Applying the damage player.getScheduler().runDelayed(...) - Folia's entity-bound scheduler (region scheduler family), 1 tick after water entry so vanilla water physics settle first
Splash particles + sound Bukkit.getRegionScheduler().run(plugin, location, ...) - Folia's location-bound region scheduler at the water block
Global schedulers None used anywhere - no Bukkit.getScheduler(), no BukkitRunnable

The scheduler calls are Paper APIs, so the same jar also runs fine on regular Paper/Purpur (they simply execute on the main thread there).

Behavior details

  • Threshold: fall-threshold: 15.0 blocks (inclusive) before damage kicks in.
  • Two damage formulas (see config):
    • VANILLA - ceil(distance - 3.0), the standard vanilla ground formula applied to the full fall (20 blocks -> 17 damage).
    • EXCESS - only the distance beyond the threshold counts (20 blocks -> 5 damage) for a gentler feel.
  • Optional hard cap per landing (max-damage).
  • Surfaces (negating-blocks): everything vanilla uses to cancel fall damage - WATER, BUBBLE_COLUMN, KELP, KELP_PLANT, SEAGRASS, TALL_SEAGRASS, COBWEB, SCAFFOLDING, HAY_BLOCK, HONEY_BLOCK, SLIME_BLOCK, POWDER_SNOW, SWEET_BERRY_BUSH. Both contact modes are covered: blocks you fall into (water, cobweb, powder snow) and blocks you land on top of (scaffolding, hay, honey, slime). Edit the list to taste - an empty list disables surface damage entirely.
  • Ignored states (no damage, tracker reset): Creative/Spectator, flying, elytra gliding, climbing, Slow Falling effect, teleports, respawns, quit.
  • Riding (rider-damage: true): vanilla gives a fall to the mount and spares the rider - a boat breaks, a horse dies, you walk away. With this on, the rider takes the same fall damage the mount does.
  • Lava is untouched (vanilla lava rules apply).
  • Depth of the water does not soften the hit - the damage lands at surface entry, like hitting water at speed in reality.
  • Impact splash/debris particles + sound (toggle: impact-effects).

Install

  1. Grab WaterFallDamage-1.1.0.jar from Releases (or build from source below).
  2. Drop it into your server's plugins/ folder.
  3. Restart (or use a plugin manager). No other setup needed.
  4. Tune plugins/WaterFallDamage/config.yml to taste, then /waterfalldamage reload (alias /wfd).

Build from source

Requires JDK 21 and Maven:

mvn package

The jar lands in target/WaterFallDamage-1.1.0.jar.

Config reference (plugins/WaterFallDamage/config.yml)

fall-threshold: 15.0      # blocks before a soft landing deals damage (inclusive)
damage-formula: VANILLA   # VANILLA = ceil(distance - 3.0) | EXCESS = ceil(distance - threshold)
max-damage: 0.0           # cap per landing, 0 = uncapped
impact-effects: true      # impact particles + sound at the contact point
debug: false              # console log of every impact
rider-damage: true        # the rider of a falling mount is hurt too
negating-blocks:          # surfaces that no longer save you
  - WATER
  - COBWEB
  - SCAFFOLDING
  # ... full default list in the shipped config.yml

Command & permission

Command Permission Default Effect
/waterfalldamage reload (/wfd reload) waterfalldamage.reload op Reload config.yml

Notes & known trade-offs

  • The threshold comparison is inclusive (>= 15.0), matching the spec.
  • The apex is captured from move packets, so the measured distance can differ from vanilla's internal counter by well under one block in edge cases (e.g. walking off a ledge). Irlevant at a 15-block threshold.
  • Waterfalls mid-fall: clipping any water (including a waterfall on the way down) counts as water entry - falling 30 blocks through a waterfall's edge will hurt at first contact. This is intentional and realistic.
  • Plugin is intentionally tiny: 2 classes, ~0 dependencies, no database.

About

Realistic fall damage when landing in water - lightweight Paper/Folia plugin for Minecraft 1.21.1

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages