#(doxaaaa) Checking if a definition returns nothing

16 messages · Page 1 of 1 (latest)

dusty crater
#
  • define item:<server.flag[server_loot_pool.<script[sellshop_items].data_key[<[value]>].get[item_data]>]>

the line above would usually return a custom item i have,

how would i check for it if it just returns nothing or just as the code shown above.

cedar ferryBOT
#

(doxaaaa) Checking if a definition returns nothing

cedar ferryBOT
#

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.

dusty crater
#

e.g something like

  • if <[item].is_null>
rose swan
#

!tag truthy

snow zodiacBOT
# rose swan !tag 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)

rose swan
#

if <[tag].is_truthy>

#

or a few other tags similarly:

#

!tag exists

snow zodiacBOT
# rose swan !tag exists
Cannot Specify Searched Tag

Multiple possible tags: <schematic[<name>].exists>, <ObjectTag.exists>, <server.scoreboard[<board>].exists>.

rose swan
#

!tag objecttag.exists

snow zodiacBOT
# rose swan !tag 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)

rose swan
#

!tag objecttag.if_null

snow zodiacBOT
# rose swan !tag 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

dusty crater
#

ah sweet