The bug
The gamemode target selector argument can normally only be written once, as a player can only be in one game mode at a time; this behavior can also be seen when using two type=
arguments, as an entity can only have one identifier. Trying to use two m=!
arguments within a target selector fails however, even though this should be valid as a player can possibly be not one of the currently five game modes available.
Steps to reproduce:
Set your game mode to Creative mode.
Go in game and try running the following command. This should return "Test passed," as you are not in survival nor Adventure mode.
/execute if entity @a[m=!survival,m=!adventure]
→❌ "Duplicate m selector arguments"
Same problem. A work around is to do if entity twice for each negated mode.
Example: /execute if entity @a[m=!survival] if entity @a[m=!adventure]
or
/execute as @a[m=!survival] if entity @s[m=!adventure]