Class Identifier

java.lang.Object
net.minecraft.util.Identifier
All Implemented Interfaces:
Comparable<Identifier>
Direct Known Subclasses:
ModelIdentifier

public class Identifier
extends Object
implements Comparable<Identifier>
The namespace and path must contain only lowercase letters ([a-z]), digits ([0-9]), or the characters '_', '.', and '-'. The path can also contain the standard path separator '/'.
Mappings:
Namespace Name
official wb
intermediary net/minecraft/class_2960
named net/minecraft/util/Identifier
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<Identifier> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Lwb;a:Lcom/mojang/serialization/Codec;
      intermediary field_25139 Lnet/minecraft/class_2960;field_25139:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/util/Identifier;CODEC:Lcom/mojang/serialization/Codec;
    • COMMAND_EXCEPTION

      private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType COMMAND_EXCEPTION
      Mappings:
      Namespace Name Mixin selector
      official d Lwb;d:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;
      intermediary field_13354 Lnet/minecraft/class_2960;field_13354:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;
      named COMMAND_EXCEPTION Lnet/minecraft/util/Identifier;COMMAND_EXCEPTION:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;
    • namespace

      protected final String namespace
      Mappings:
      Namespace Name Mixin selector
      official b Lwb;b:Ljava/lang/String;
      intermediary field_13353 Lnet/minecraft/class_2960;field_13353:Ljava/lang/String;
      named namespace Lnet/minecraft/util/Identifier;namespace:Ljava/lang/String;
    • path

      protected final String path
      Mappings:
      Namespace Name Mixin selector
      official c Lwb;c:Ljava/lang/String;
      intermediary field_13355 Lnet/minecraft/class_2960;field_13355:Ljava/lang/String;
      named path Lnet/minecraft/util/Identifier;path:Ljava/lang/String;
  • Constructor Details

    • Identifier

      protected Identifier​(String[] id)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lwb;<init>([Ljava/lang/String;)V
      intermediary <init> Lnet/minecraft/class_2960;<init>([Ljava/lang/String;)V
      named <init> Lnet/minecraft/util/Identifier;<init>([Ljava/lang/String;)V
    • Identifier

      public Identifier​(String id)

      Takes a string of the form <namespace>:<path>, for example minecraft:iron_ingot.

      The string will be split (on the :) into an identifier with the specified path and namespace.

      Prefer using the Identifier(java.lang.String, java.lang.String) constructor that takes the namespace and path as individual parameters to avoid mistakes.
      Throws:
      InvalidIdentifierException - if the string cannot be parsed as an identifier.
      Mappings:
      Namespace Name Mixin selector
      official <init> Lwb;<init>(Ljava/lang/String;)V
      intermediary <init> Lnet/minecraft/class_2960;<init>(Ljava/lang/String;)V
      named <init> Lnet/minecraft/util/Identifier;<init>(Ljava/lang/String;)V
    • Identifier

      public Identifier​(String namespace, String path)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lwb;<init>(Ljava/lang/String;Ljava/lang/String;)V
      intermediary <init> Lnet/minecraft/class_2960;<init>(Ljava/lang/String;Ljava/lang/String;)V
      named <init> Lnet/minecraft/util/Identifier;<init>(Ljava/lang/String;Ljava/lang/String;)V
  • Method Details

    • splitOn

      public static Identifier splitOn​(String id, char delimiter)
      Mappings:
      Namespace Name Mixin selector
      official a Lwb;a(Ljava/lang/String;C)Lwb;
      intermediary method_12838 Lnet/minecraft/class_2960;method_12838(Ljava/lang/String;C)Lnet/minecraft/class_2960;
      named splitOn Lnet/minecraft/util/Identifier;splitOn(Ljava/lang/String;C)Lnet/minecraft/util/Identifier;
    • tryParse

      @Nullable public static Identifier tryParse​(String id)

      Parses a string into an Identifier.

      Takes a string of the form <namespace>:<path>, for example minecraft:iron_ingot.
      Returns:
      resulting identifier, or null if the string couldn't be parsed as an identifier
      Mappings:
      Namespace Name Mixin selector
      official a Lwb;a(Ljava/lang/String;)Lwb;
      intermediary method_12829 Lnet/minecraft/class_2960;method_12829(Ljava/lang/String;)Lnet/minecraft/class_2960;
      named tryParse Lnet/minecraft/util/Identifier;tryParse(Ljava/lang/String;)Lnet/minecraft/util/Identifier;
    • split

      protected static String[] split​(String id, char delimiter)
      Mappings:
      Namespace Name Mixin selector
      official b Lwb;b(Ljava/lang/String;C)[Ljava/lang/String;
      intermediary method_12830 Lnet/minecraft/class_2960;method_12830(Ljava/lang/String;C)[Ljava/lang/String;
      named split Lnet/minecraft/util/Identifier;split(Ljava/lang/String;C)[Ljava/lang/String;
    • validate

      private static com.mojang.serialization.DataResult<Identifier> validate​(String id)
      Mappings:
      Namespace Name Mixin selector
      official c Lwb;c(Ljava/lang/String;)Lcom/mojang/serialization/DataResult;
      intermediary method_29186 Lnet/minecraft/class_2960;method_29186(Ljava/lang/String;)Lcom/mojang/serialization/DataResult;
      named validate Lnet/minecraft/util/Identifier;validate(Ljava/lang/String;)Lcom/mojang/serialization/DataResult;
    • getPath

      public String getPath()
      Mappings:
      Namespace Name Mixin selector
      official a Lwb;a()Ljava/lang/String;
      intermediary method_12832 Lnet/minecraft/class_2960;method_12832()Ljava/lang/String;
      named getPath Lnet/minecraft/util/Identifier;getPath()Ljava/lang/String;
    • getNamespace

      public String getNamespace()
      Mappings:
      Namespace Name Mixin selector
      official b Lwb;b()Ljava/lang/String;
      intermediary method_12836 Lnet/minecraft/class_2960;method_12836()Ljava/lang/String;
      named getNamespace Lnet/minecraft/util/Identifier;getNamespace()Ljava/lang/String;
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Mappings:
      Namespace Name Mixin selector
      official toString Lwb;toString()Ljava/lang/String;
      intermediary toString Lnet/minecraft/class_2960;toString()Ljava/lang/String;
      named toString Lnet/minecraft/util/Identifier;toString()Ljava/lang/String;
    • equals

      public boolean equals​(Object other)
      Overrides:
      equals in class Object
      Mappings:
      Namespace Name Mixin selector
      official equals Lwb;equals(Ljava/lang/Object;)Z
      intermediary equals Lnet/minecraft/class_2960;equals(Ljava/lang/Object;)Z
      named equals Lnet/minecraft/util/Identifier;equals(Ljava/lang/Object;)Z
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Mappings:
      Namespace Name Mixin selector
      official hashCode Lwb;hashCode()I
      intermediary hashCode Lnet/minecraft/class_2960;hashCode()I
      named hashCode Lnet/minecraft/util/Identifier;hashCode()I
    • compareTo

      public int compareTo​(Identifier identifier)
      Specified by:
      compareTo in interface Comparable<Identifier>
      Mappings:
      Namespace Name Mixin selector
      official a Lwb;a(Lwb;)I
      intermediary method_12833 Lnet/minecraft/class_2960;method_12833(Lnet/minecraft/class_2960;)I
      named compareTo Lnet/minecraft/util/Identifier;compareTo(Lnet/minecraft/util/Identifier;)I
    • fromCommandInput

      public static Identifier fromCommandInput​(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
      Mappings:
      Namespace Name Mixin selector
      official a Lwb;a(Lcom/mojang/brigadier/StringReader;)Lwb;
      intermediary method_12835 Lnet/minecraft/class_2960;method_12835(Lcom/mojang/brigadier/StringReader;)Lnet/minecraft/class_2960;
      named fromCommandInput Lnet/minecraft/util/Identifier;fromCommandInput(Lcom/mojang/brigadier/StringReader;)Lnet/minecraft/util/Identifier;
    • isCharValid

      public static boolean isCharValid​(char c)
      Mappings:
      Namespace Name Mixin selector
      official a Lwb;a(C)Z
      intermediary method_12831 Lnet/minecraft/class_2960;method_12831(C)Z
      named isCharValid Lnet/minecraft/util/Identifier;isCharValid(C)Z
    • isPathValid

      private static boolean isPathValid​(String path)
      Mappings:
      Namespace Name Mixin selector
      official d Lwb;d(Ljava/lang/String;)Z
      intermediary method_20208 Lnet/minecraft/class_2960;method_20208(Ljava/lang/String;)Z
      named isPathValid Lnet/minecraft/util/Identifier;isPathValid(Ljava/lang/String;)Z
    • isNamespaceValid

      private static boolean isNamespaceValid​(String namespace)
      Mappings:
      Namespace Name Mixin selector
      official e Lwb;e(Ljava/lang/String;)Z
      intermediary method_20209 Lnet/minecraft/class_2960;method_20209(Ljava/lang/String;)Z
      named isNamespaceValid Lnet/minecraft/util/Identifier;isNamespaceValid(Ljava/lang/String;)Z
    • isPathCharacterValid

      public static boolean isPathCharacterValid​(char character)
      Mappings:
      Namespace Name Mixin selector
      official b Lwb;b(C)Z
      intermediary method_29184 Lnet/minecraft/class_2960;method_29184(C)Z
      named isPathCharacterValid Lnet/minecraft/util/Identifier;isPathCharacterValid(C)Z
    • isNamespaceCharacterValid

      private static boolean isNamespaceCharacterValid​(char character)
      Mappings:
      Namespace Name Mixin selector
      official c Lwb;c(C)Z
      intermediary method_29185 Lnet/minecraft/class_2960;method_29185(C)Z
      named isNamespaceCharacterValid Lnet/minecraft/util/Identifier;isNamespaceCharacterValid(C)Z
    • isValid

      @Environment(CLIENT) public static boolean isValid​(String id)
      Mappings:
      Namespace Name Mixin selector
      official b Lwb;b(Ljava/lang/String;)Z
      intermediary method_20207 Lnet/minecraft/class_2960;method_20207(Ljava/lang/String;)Z
      named isValid Lnet/minecraft/util/Identifier;isValid(Ljava/lang/String;)Z