#Determining gamemode of a player from script

22 messages · Page 1 of 1 (latest)

thorn vigil
#

I want to know how can i determine gamemode of a player. the player is stored in variable named player

spring mirage
#

hmmm

#

u can do function

#

which will add scoreboard "gm"

#
scoreboard objectives add gm dummy
scoreboard players add @a gm 0
scoreboard players set @a[m=s] gm 1 
scoreboard players set @a[m=c] gm 2
scoreboard players set @a[m=a] gm 3
scoreboard players set @a[m=spectator] gm 4
#

then get getScore functikn3

#

function *

#

and use this:

#
world.events.tick.subscribe(d => {
        const survival = []
        for (const p of world.getPlayers()) {
           if (gS(p, "gm") == 1)) {
                  survival.push(p.name)
           }
       }
})
#

@thorn vigil

#

i think this can work

#

but i am not sure

thorn vigil
#

yes it will work

#

but i dont know why did they not add Player.GameMode property

spring mirage
#

idk

#

cuz they are lazy bitches

thorn vigil
#

lol

#

true

spring mirage
#

ye

#

average mojang developer

thorn vigil
#

yes

spring mirage
#

yes