Disable Elytra in Region
A simple and efficient datapack to disable Elytra flight, eschewing methods like removing the Elytra or teleporting the player.
Disable Elytra in Region
This datapack is a simple and efficient pack to disable Elytra flight in a region, or the entire world.
Basic knowledge of commands is necessary to configure the pack and enable the functionality. See the README for more details about configuration.
Methods
This pack uses a predicate search on a ticking basis, for players wearing Elytra in the chest slot and also in-flight. Using that single selection, it invokes the second function to give the player levitation, which breaks their flight. To immediately cause the player to fall instead of float, another function is then scheduled 0.1s later to clear the levitation effect and inform the player that Elytra use is disallowed.
Uninstallation
This pack provides an uninstallation function that removes its scoreboard objectives. See the README for more details.