Deny Elytra Flight
No elytra flying. Tiny and optimised pack using the new 1.21.2 glider data component to disable elytra flight once equipped.
Quick challenge
How far can you run before the mobs catch you?
Minecraft check
Confirm your run
Complete the quick check to get your code.
Deny Elytra Flight
With the new 1.21.2 glider data component, disabling elytra is able to be done cleanly with commands. This tiny datapack is optimised for performance by using a hidden advancement to only modify elytra upon being equipped, instead of checking every tick.
Restoring Elytra (Uninstall Instructions)
Run the following command once you've disabled the datapack to restore all elytra currently worn back to Vanilla behaviour:
```mcfunction /item modify entity @a[nbt={equipment:{chest:{id:"minecraft:elytra"}}}] armor.chest {function: "minecraft:set_components", components: {"minecraft:glider": {}}} ```