1
All you command block experts out there, please help.
I want to make a way to stop flying with an elytra midair by pressing crouch. I’m thinking maybe testing with a command block whether a player is flying with elytra, then if yes, test whether they are crouching or not. Then, if yes, somehow make them stop flying. Is there a way to do this? Please help. If you can, send a command that I can copy-paste into a command block, as I’m not very good at commands.
7
Thanks
You can use the FallFlying nbt and then detect if the player is crouching or not, using scoreboard commands.
However this is only detection of when you're flying and crouching, and as far as I know, there is no way to stop a player from flying their elytra
However this is only detection of when you're flying and crouching, and as far as I know, there is no way to stop a player from flying their elytra
But other wise can you help me with the exact commands?
There is. I’ve made a way. I’ve used the /replaceitem and /clear commands to take the elytra out of the inventory and then replace it in 2 ticks.
/scoreboard objectives add crouch_score minecraft:custom.sneak_timeRepeating CMD block:
execute as @a[scores={crouch_score=2..}] run scoreboard players reset @s crouch_scoreRepeating CMD block/s
/execute as @a[nbt={FallFlying:1b},scores={crouch_score=1}] run <commands>It I need to run 2 different commands, and there is only space for one.
yes you need 2 command blocks for this.
