Class AbstractNbtNumber

java.lang.Object
net.minecraft.nbt.AbstractNbtNumber
All Implemented Interfaces:
NbtElement
Direct Known Subclasses:
NbtByte, NbtDouble, NbtFloat, NbtInt, NbtLong, NbtShort

public abstract class AbstractNbtNumber
extends Object
implements NbtElement
Represents an NBT number.

The type 99 can be used to check for the existence of any numeric element in a NBT compound object.

  • Constructor Details

    • AbstractNbtNumber

      protected AbstractNbtNumber()
  • Method Details

    • longValue

      public abstract long longValue()
      Gets the value as a 64-bit integer.
      Returns:
      the value as a long
    • intValue

      public abstract int intValue()
      Gets the value as a 32-bit integer.
      Returns:
      the value as an int
    • shortValue

      public abstract short shortValue()
      Gets the value as a 16-bit integer.
      Returns:
      the value as a short
    • byteValue

      public abstract byte byteValue()
      Gets the value as an 8-bit integer.
      Returns:
      the value as a byte
    • doubleValue

      public abstract double doubleValue()
      Gets the value as a 64-bit floating-point number.
      Returns:
      the value as a double
    • floatValue

      public abstract float floatValue()
      Gets the value as a 32-bit floating-point number.
      Returns:
      the value as a float
    • numberValue

      public abstract Number numberValue()
      Gets the value as a generic number.
      Returns:
      the value as a Number