Denizen Script Tags


Tags are always written with a <between these marks>, and are critical to scripts, as the primary way to read data.
Learn about how tags work in The Beginner's Guide.


Showing 1 out of 2484 tags...
Name<ListTag.first[(<#>)]>
ReturnsObjectTag
DescriptionReturns the first element in the list.
If the list is empty, returns null instead.
Effectively equivalent to .get[1]
Optionally, specify a number of entries to get, which will return the # first entries, equivalent to .get[1].to[#]
Example
# Narrates "one"
- narrate <list[one|two|three].first>
Example
# Narrates a list of "one" and "two"
- narrate <list[one|two|three].first[2]>
Example
# Narrates a list of "one", "two", and "three"
- narrate <list[one|two|three].first[5]>
Example
# Causes an error, as the list is empty.
- narrate <list.first>
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/objects/core/ListTag.java#L1823