MCreator issue tracker has been migrated to GitHub.
Existing tickets have been migrated to GitHub. Please open new tickets on the GitHub tracker instead. If you do not have a GitHub account, all feature requests and bug reports from forums are still considered and checked by the maintainers.
You can use global trigger when entity hurt, check if it is player type entity and check if the player has the item in slot in such case. If this is not the case, turn off flying using proper procedure block.