A simple datapack for Minecraft 1.21.5 for warning the player when their elytra is about to break.
This is solely achieved via trigger
commands and therefore none of the players are required to have op-level privileges.
- Download the datapack and simply place it in your world's
datapack
folder - Reload all datapacks or directly enable the pack via
/datapack enable "file/elytra-warning"
- Enable and toggle the warning display via
/trigger elytra_warning
The threshold for displaying the warning is controlled by the elytra_durability_threshold
scoreboard objective and is set to 32
by default.
You can modify this value temporarily via:
/scoreboard players set @a elytra_durability_threshold <value>
or permanently by going into <DATAPACK-FOLDER>/elytra-warning/data/elytrawarning/function/load.mcfunction
and modifying the marked command.
If you want to remove all the scoreboard objectives used by the datapack, run
/function elytrawarning:remove
before disabling the pack.