Skip to content

Instantly share code, notes, and snippets.

@FaustVX
Last active September 10, 2020 04:11
Show Gist options
  • Save FaustVX/70deb7980d5398e861697f046e7f0def to your computer and use it in GitHub Desktop.
Save FaustVX/70deb7980d5398e861697f046e7f0def to your computer and use it in GitHub Desktop.
# run each tick 'execute as @e[] run namespace:detect_moving_entity'
# then execute as @e[tag=takeoff] ...
# the `flying` tag is present even in `takeoff` and `landing` phases
tag @s[tag=flying, tag=landing] remove flying
tag @s[tag=landing] remove landing
tag @s[tag=flying, tag=!landing, nbt={Motion:[0d,0d,0d], OnGround:true}] add landing
tag @s[tag=takeoff] remove takeoff
tag @s[tag=!takeoff, tag=!flying, tag=!landing, nbt=!{Motion:[0d,0d,0d]}] add takeoff
tag @s[tag= takeoff, tag=!flying, tag=!landing, nbt=!{Motion:[0d,0d,0d]}] add flying
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment