mojira.dev
MCPE-158042

/testfor command cannot target spectators

Target selectors can use the "m" selector argument to limit selection by game mode, but there is no value to select only players in Spectator mode.

To Reproduce: Run the following command:

/testfor @a[m=spectator]

Expected result: List of spectators were shown
Observed: The error "Game mode 'spectator' is invalid' was shown instead

Linked issues

Comments 1

no command can test for m=spectator. not sure why.. I tried to use it for /tellraw @a[m=!spectator] but it just says "Game mode 'spectator' is invalid". I instead made 2 sets of command blocks for m=creative and m=survival to work around this.

FrostIce482

(Unassigned)

811324

Confirmed

Windows

Windows 10 (10.0.19044.1526)

selector, selector-argument, target-selector, testfor

1.19.20.22 Preview, 1.19.10.23 Preview, 1.19.0, 1.19.10, 1.19.20.24 Preview, 1.19.11 Hotfix, 1.19.21 Hotfix

1.19.30.20 Preview, 1.19.30

Retrieved