#(cattamer19) Efficient way of getting playertag through name

23 messages · Page 1 of 1 (latest)

fluid iceBOT
#

(cattamer19) Efficient way of getting playertag through name

#

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.

main ridge
#

!t objecttag.if_null

steady ventureBOT
# main ridge !t objecttag.if_null

If the object is null (or the tag errors), this will return the input object.
If the object isn't null, the input won't be parsed, and the original object will be returned.
For example, "<player.if_null[<npc>]>" will return the player if there is a player, and otherwise will return the NPC.
This functions as a fallback - meaning, if the tag up to this point errors, that error will be hidden.

Returns

ObjectTag

main ridge
#

Or, alternatively.

#

!t objecttag.exists

steady ventureBOT
# main ridge !t objecttag.exists

Returns true if the object exists (is non-null). Returns false if the object doesn't exist, is null, or the tag errored.
This functions as a fallback - meaning, if the tag up to this point errors, that error will be hidden.

Returns

ElementTag(Boolean)

main ridge
#

Some individuals use the tag is_truthy but I'm not familiar enough to tell you if it's appropriate for this.

#

!t is_truthy

steady ventureBOT
# main ridge !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)

cursive galleonBOT
#
Resolved

Thread closed as resolved.

static depot
#

uh oops

cursive galleonBOT
#
Thread Reopened

Thread was manually reopened by @static depot.

static depot
#

I found out how to do this by using the .as[player] tag

#

thank you

cursive galleonBOT
#
Resolved

Thread closed as resolved.

#
Thread Reopened

Thread was manually reopened by @static depot.

#
Thread Reopened

Thread was manually reopened by @static depot.

#
Resolved

Thread closed as resolved.

static depot
#

what

cursive galleonBOT
#
Thread Reopened

Thread was manually reopened by @static depot.

static depot
#

why is it reopening