Class NbtString

java.lang.Object
net.minecraft.nbt.NbtString
All Implemented Interfaces:
NbtElement

public class NbtString extends Object implements NbtElement
Represents an NBT string. Its type is 0x8. Instances are immutable.
Mappings:
Namespace Name
named net/minecraft/nbt/NbtString
intermediary net/minecraft/class_2519
official ul
  • Field Details Link icon

    • SIZE Link icon

      private static final int SIZE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named SIZE Lnet/minecraft/nbt/NbtString;SIZE:I
      intermediary field_41729 Lnet/minecraft/class_2519;field_41729:I
      official b Lul;b:I
    • TYPE Link icon

      public static final NbtType<NbtString> TYPE
      Mappings:
      Namespace Name Mixin selector
      named TYPE Lnet/minecraft/nbt/NbtString;TYPE:Lnet/minecraft/nbt/NbtType;
      intermediary field_21045 Lnet/minecraft/class_2519;field_21045:Lnet/minecraft/class_4614;
      official a Lul;a:Lup;
    • EMPTY Link icon

      private static final NbtString EMPTY
      Mappings:
      Namespace Name Mixin selector
      named EMPTY Lnet/minecraft/nbt/NbtString;EMPTY:Lnet/minecraft/nbt/NbtString;
      intermediary field_21046 Lnet/minecraft/class_2519;field_21046:Lnet/minecraft/class_2519;
      official c Lul;c:Lul;
    • DOUBLE_QUOTE Link icon

      private static final char DOUBLE_QUOTE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DOUBLE_QUOTE Lnet/minecraft/nbt/NbtString;DOUBLE_QUOTE:C
      intermediary field_33242 Lnet/minecraft/class_2519;field_33242:C
      official w Lul;w:C
    • SINGLE_QUOTE Link icon

      private static final char SINGLE_QUOTE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named SINGLE_QUOTE Lnet/minecraft/nbt/NbtString;SINGLE_QUOTE:C
      intermediary field_33243 Lnet/minecraft/class_2519;field_33243:C
      official x Lul;x:C
    • BACKSLASH Link icon

      private static final char BACKSLASH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named BACKSLASH Lnet/minecraft/nbt/NbtString;BACKSLASH:C
      intermediary field_33244 Lnet/minecraft/class_2519;field_33244:C
      official y Lul;y:C
    • NULL Link icon

      private static final char NULL
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named NULL Lnet/minecraft/nbt/NbtString;NULL:C
      intermediary field_33245 Lnet/minecraft/class_2519;field_33245:C
      official z Lul;z:C
    • value Link icon

      private final String value
      Mappings:
      Namespace Name Mixin selector
      named value Lnet/minecraft/nbt/NbtString;value:Ljava/lang/String;
      intermediary field_11590 Lnet/minecraft/class_2519;field_11590:Ljava/lang/String;
      official A Lul;A:Ljava/lang/String;
  • Constructor Details Link icon

    • NbtString Link icon

      private NbtString(String value)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/nbt/NbtString;<init>(Ljava/lang/String;)V
      intermediary <init> Lnet/minecraft/class_2519;<init>(Ljava/lang/String;)V
      official <init> Lul;<init>(Ljava/lang/String;)V
  • Method Details Link icon

    • skip Link icon

      public static void skip(DataInput input) throws IOException
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named skip Lnet/minecraft/nbt/NbtString;skip(Ljava/io/DataInput;)V
      intermediary method_39875 Lnet/minecraft/class_2519;method_39875(Ljava/io/DataInput;)V
      official a Lul;a(Ljava/io/DataInput;)V
    • of Link icon

      public static NbtString of(String value)
      Returns the NBT string from value.
      Returns:
      the NBT string from value
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/nbt/NbtString;of(Ljava/lang/String;)Lnet/minecraft/nbt/NbtString;
      intermediary method_23256 Lnet/minecraft/class_2519;method_23256(Ljava/lang/String;)Lnet/minecraft/class_2519;
      official a Lul;a(Ljava/lang/String;)Lul;
    • write Link icon

      public void write(DataOutput output) throws IOException
      Writes the NBT element to output.
      Specified by:
      write in interface NbtElement
      Throws:
      IOException
      API Note:
      This is a low-level method for serializing NBT elements; consider using NbtIo, NbtOps, or PacketByteBuf.writeNbt(net.minecraft.nbt.NbtElement) instead.
      Mappings:
      Namespace Name Mixin selector
      named write Lnet/minecraft/nbt/NbtElement;write(Ljava/io/DataOutput;)V
      intermediary method_10713 Lnet/minecraft/class_2520;method_10713(Ljava/io/DataOutput;)V
      official a Lun;a(Ljava/io/DataOutput;)V
    • getSizeInBytes Link icon

      public int getSizeInBytes()
      Specified by:
      getSizeInBytes in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named getSizeInBytes Lnet/minecraft/nbt/NbtElement;getSizeInBytes()I
      intermediary method_47988 Lnet/minecraft/class_2520;method_47988()I
      official a Lun;a()I
    • getType Link icon

      public byte getType()
      Returns the type of this NBT element.
      Specified by:
      getType in interface NbtElement
      Returns:
      the type of this NBT element
      Mappings:
      Namespace Name Mixin selector
      named getType Lnet/minecraft/nbt/NbtElement;getType()B
      intermediary method_10711 Lnet/minecraft/class_2520;method_10711()B
      official b Lun;b()B
    • getNbtType Link icon

      public NbtType<NbtString> getNbtType()
      Returns the NBT type definition of this NBT element.
      Specified by:
      getNbtType in interface NbtElement
      Returns:
      the NBT type definition of this NBT element
      Mappings:
      Namespace Name Mixin selector
      named getNbtType Lnet/minecraft/nbt/NbtElement;getNbtType()Lnet/minecraft/nbt/NbtType;
      intermediary method_23258 Lnet/minecraft/class_2520;method_23258()Lnet/minecraft/class_4614;
      official c Lun;c()Lup;
    • toString Link icon

      public String toString()
      Specified by:
      toString in interface NbtElement
      Overrides:
      toString in class Object
    • copy Link icon

      public NbtString copy()
      Description copied from interface: NbtElement
      Returns an NBT element of equal value that won't change with this element.
      Specified by:
      copy in interface NbtElement
      Returns:
      an NBT element of equal value that won't change with this element
      Mappings:
      Namespace Name Mixin selector
      named copy Lnet/minecraft/nbt/NbtString;copy()Lnet/minecraft/nbt/NbtString;
      intermediary method_10705 Lnet/minecraft/class_2519;method_10705()Lnet/minecraft/class_2519;
      official e Lul;e()Lul;
    • equals Link icon

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Mappings:
      Namespace Name Mixin selector
      named equals Lnet/minecraft/nbt/NbtString;equals(Ljava/lang/Object;)Z
      intermediary equals Lnet/minecraft/class_2519;equals(Ljava/lang/Object;)Z
      official equals Lul;equals(Ljava/lang/Object;)Z
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • asString Link icon

      public String asString()
      Returns the NBT's string representation.
      Specified by:
      asString in interface NbtElement
      Returns:
      the NBT's string representation
      Implementation Note:
      By default, this returns the same result as StringNbtWriter. NbtString will return its string value instead.
      Mappings:
      Namespace Name Mixin selector
      named asString Lnet/minecraft/nbt/NbtElement;asString()Ljava/lang/String;
      intermediary method_10714 Lnet/minecraft/class_2520;method_10714()Ljava/lang/String;
      official u_ Lun;u_()Ljava/lang/String;
    • accept Link icon

      public void accept(NbtElementVisitor visitor)
      Specified by:
      accept in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named accept Lnet/minecraft/nbt/NbtElement;accept(Lnet/minecraft/nbt/visitor/NbtElementVisitor;)V
      intermediary method_32289 Lnet/minecraft/class_2520;method_32289(Lnet/minecraft/class_5627;)V
      official a Lun;a(Lur;)V
    • escape Link icon

      public static String escape(String value)
      Returns the string quoted with quotes and backslashes escaped.
      Returns:
      the string quoted with quotes and backslashes escaped
      Implementation Note:
      If value contains one of the singlequote or the double quote, it tries to use the other quotes to quote the string. If both appear, then the quote that appeared later will be used to quote the string. If neither of them appears, this uses a double quote. For example, the string It's a "Tiny Potato"! will be escaped as "It's a \"Tiny Potato\"!", while the string It is a "Tiny Potato"! will be escaped as 'It is a "Tiny Potato"!'.
      Mappings:
      Namespace Name Mixin selector
      named escape Lnet/minecraft/nbt/NbtString;escape(Ljava/lang/String;)Ljava/lang/String;
      intermediary method_10706 Lnet/minecraft/class_2519;method_10706(Ljava/lang/String;)Ljava/lang/String;
      official b Lul;b(Ljava/lang/String;)Ljava/lang/String;
    • doAccept Link icon

      public NbtScanner.Result doAccept(NbtScanner visitor)
      Specified by:
      doAccept in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named doAccept Lnet/minecraft/nbt/NbtElement;doAccept(Lnet/minecraft/nbt/scanner/NbtScanner;)Lnet/minecraft/nbt/scanner/NbtScanner$Result;
      intermediary method_39850 Lnet/minecraft/class_2520;method_39850(Lnet/minecraft/class_6836;)Lnet/minecraft/class_6836$class_6838;
      official a Lun;a(Luk;)Luk$b;