Package com.viaversion.nbt.tag
Interface NumberTag
- All Superinterfaces:
Tag
Abstract class representing a number tag, containing methods to return primitive number types.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanGets the boolean value of this tag.byteasByte()Gets the byte value of this tag.doubleasDouble()Gets the double value of this tag.floatasFloat()Gets the float value of this tag.intasInt()Gets the int value of this tag.longasLong()Gets the long value of this tag.shortasShort()Gets the short value of this tag.default NumberTagcopy()Returns a copy of this tag.getValue()Gets the number value of this tag.Methods inherited from interface com.viaversion.nbt.tag.Tag
asRawString, getTagId, write
-
Method Details
-
getValue
Number getValue()Gets the number value of this tag. -
asByte
byte asByte()Gets the byte value of this tag.- Returns:
- Byte value of this tag.
-
asShort
short asShort()Gets the short value of this tag.- Returns:
- Short value of this tag.
-
asInt
int asInt()Gets the int value of this tag.- Returns:
- Int value of this tag.
-
asLong
long asLong()Gets the long value of this tag.- Returns:
- Long value of this tag.
-
asFloat
float asFloat()Gets the float value of this tag.- Returns:
- Float value of this tag.
-
asDouble
double asDouble()Gets the double value of this tag.- Returns:
- Double value of this tag.
-
asBoolean
default boolean asBoolean()Gets the boolean value of this tag.Booleans do not have a direct nbt representation in NBT per se, but check whether a number value is different to 0.
- Returns:
- Boolean value of this tag.
-
copy
Description copied from interface:TagReturns a copy of this tag.
-