Interface AbstractNbtNumber

All Superinterfaces:
NbtElement, NbtPrimitive
All Known Implementing Classes:
NbtByte, NbtDouble, NbtFloat, NbtInt, NbtLong, NbtShort

public non-sealed interface AbstractNbtNumber extends NbtPrimitive
Represents an NBT number.

The type

invalid reference
NUMBER_TYPE
can be used to check for the existence of any numeric element in a NBT compound object.
Mappings:
Namespace Name
named net/minecraft/nbt/AbstractNbtNumber
intermediary net/minecraft/class_2514
official up
  • Method Details

    • byteValue

      byte byteValue()
      Gets the value as an 8-bit integer.
      Returns:
      the value as a byte
      Mappings:
      Namespace Name Mixin selector
      named byteValue Lnet/minecraft/nbt/AbstractNbtNumber;byteValue()B
      intermediary method_10698 Lnet/minecraft/class_2514;method_10698()B
      official j Lup;j()B
    • shortValue

      short shortValue()
      Gets the value as a 16-bit integer.
      Returns:
      the value as a short
      Mappings:
      Namespace Name Mixin selector
      named shortValue Lnet/minecraft/nbt/AbstractNbtNumber;shortValue()S
      intermediary method_10696 Lnet/minecraft/class_2514;method_10696()S
      official i Lup;i()S
    • intValue

      int intValue()
      Gets the value as a 32-bit integer.
      Returns:
      the value as an int
      Mappings:
      Namespace Name Mixin selector
      named intValue Lnet/minecraft/nbt/AbstractNbtNumber;intValue()I
      intermediary method_10701 Lnet/minecraft/class_2514;method_10701()I
      official h Lup;h()I
    • longValue

      long longValue()
      Gets the value as a 64-bit integer.
      Returns:
      the value as a long
      Mappings:
      Namespace Name Mixin selector
      named longValue Lnet/minecraft/nbt/AbstractNbtNumber;longValue()J
      intermediary method_10699 Lnet/minecraft/class_2514;method_10699()J
      official g Lup;g()J
    • floatValue

      float floatValue()
      Gets the value as a 32-bit floating-point number.
      Returns:
      the value as a float
      Mappings:
      Namespace Name Mixin selector
      named floatValue Lnet/minecraft/nbt/AbstractNbtNumber;floatValue()F
      intermediary method_10700 Lnet/minecraft/class_2514;method_10700()F
      official l Lup;l()F
    • doubleValue

      double doubleValue()
      Gets the value as a 64-bit floating-point number.
      Returns:
      the value as a double
      Mappings:
      Namespace Name Mixin selector
      named doubleValue Lnet/minecraft/nbt/AbstractNbtNumber;doubleValue()D
      intermediary method_10697 Lnet/minecraft/class_2514;method_10697()D
      official k Lup;k()D
    • numberValue

      Number numberValue()
      Gets the value as a generic number.
      Returns:
      the value as a Number
      Mappings:
      Namespace Name Mixin selector
      named numberValue Lnet/minecraft/nbt/AbstractNbtNumber;numberValue()Ljava/lang/Number;
      intermediary method_10702 Lnet/minecraft/class_2514;method_10702()Ljava/lang/Number;
      official m Lup;m()Ljava/lang/Number;
    • castToNumber

      default Optional<Number> castToNumber()
      Specified by:
      castToNumber in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named castToNumber Lnet/minecraft/nbt/NbtElement;castToNumber()Ljava/util/Optional;
      intermediary method_68599 Lnet/minecraft/class_2520;method_68599()Ljava/util/Optional;
      official o Luy;o()Ljava/util/Optional;
    • castToByte

      default Optional<Byte> castToByte()
      Specified by:
      castToByte in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named castToByte Lnet/minecraft/nbt/NbtElement;castToByte()Ljava/util/Optional;
      intermediary method_68600 Lnet/minecraft/class_2520;method_68600()Ljava/util/Optional;
      official p Luy;p()Ljava/util/Optional;
    • castToShort

      default Optional<Short> castToShort()
      Specified by:
      castToShort in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named castToShort Lnet/minecraft/nbt/NbtElement;castToShort()Ljava/util/Optional;
      intermediary method_68601 Lnet/minecraft/class_2520;method_68601()Ljava/util/Optional;
      official q Luy;q()Ljava/util/Optional;
    • castToInt

      default Optional<Integer> castToInt()
      Specified by:
      castToInt in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named castToInt Lnet/minecraft/nbt/NbtElement;castToInt()Ljava/util/Optional;
      intermediary method_68602 Lnet/minecraft/class_2520;method_68602()Ljava/util/Optional;
      official r Luy;r()Ljava/util/Optional;
    • castToLong

      default Optional<Long> castToLong()
      Specified by:
      castToLong in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named castToLong Lnet/minecraft/nbt/NbtElement;castToLong()Ljava/util/Optional;
      intermediary method_68603 Lnet/minecraft/class_2520;method_68603()Ljava/util/Optional;
      official s Luy;s()Ljava/util/Optional;
    • castToFloat

      default Optional<Float> castToFloat()
      Specified by:
      castToFloat in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named castToFloat Lnet/minecraft/nbt/NbtElement;castToFloat()Ljava/util/Optional;
      intermediary method_68604 Lnet/minecraft/class_2520;method_68604()Ljava/util/Optional;
      official t Luy;t()Ljava/util/Optional;
    • castToDouble

      default Optional<Double> castToDouble()
      Specified by:
      castToDouble in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named castToDouble Lnet/minecraft/nbt/NbtElement;castToDouble()Ljava/util/Optional;
      intermediary method_68605 Lnet/minecraft/class_2520;method_68605()Ljava/util/Optional;
      official u Luy;u()Ljava/util/Optional;
    • castToBoolean

      default Optional<Boolean> castToBoolean()
      Specified by:
      castToBoolean in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named castToBoolean Lnet/minecraft/nbt/NbtElement;castToBoolean()Ljava/util/Optional;
      intermediary method_68606 Lnet/minecraft/class_2520;method_68606()Ljava/util/Optional;
      official v Luy;v()Ljava/util/Optional;