#(sytek3299) new tag for server.player_is_valid, if <context.server>

23 messages · Page 1 of 1 (latest)

tawny junco
#

I was using denizen very long ago and could not find what is the replacement of server.player_is_valid
or checking if denizen script command is run in console if <context.server>

compact compassBOT
#

(sytek3299) new tag for server.player_is_valid

compact compassBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

tawny junco
#

(sytek3299) new tag for server.player_is_valid, if <context.server>

opaque pulsarBOT
tawny junco
#

thanks

#

then i need to check if that not null

#

unlike old tag player_is_valid return true false

#

if no other option then ill take it

frank epoch
#

I assume you could do <server.match_player[].is_online.if_null[false]> or <server.match_player[].is_truthy.if_null[false]>

austere hazel
#

!t is_truthy

opaque pulsarBOT
# austere hazel !t is_truthy

Returns true if the object is 'truthy'. An object is 'truthy' if it exists and is valid, and does not represent a concept like emptiness.
An empty list or an air item will return 'false'. Plaintext "null" or "false", an empty element, or a numeric zero will return 'false' as well.
Some object types may have their own logical implementations, for examples an EntityTag value is 'truthy' only if the entity it represents is spawned.
Errored/broken/invalid tags are also considered 'false' by this log...

Returns

ElementTag(Boolean)

austere hazel
#

^ it's already a fallback, no need for an extra if_null

#

Also pretty sure player_is_valid was just a "whether the server has a player by that name", not an online check

#

But depending on what you're doing you probably don't need that sort of check anymore, e.g. if it's in a command script you'd just

- define player <server.match_player[<context.args.first>].if_null[null]>
- if <[player]> == null:
  - narrate bad
  - stop
- do things

I.e. just get the player once with a fallback instead of having 2 separate checks

tawny junco
#

cool so we have is_truthy too

#

its gonna take me sometime to get familar with all the new tags

#

thank you

ember pilotBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@tawny junco