Interface Identifier


public interface Identifier
An identifying object for representing unique objects. This identifier consists of two parts:
  • a namespace, which is usually a name identifying your work
  • a path, which holds a value.
Examples of identifiers:
  • minecraft:fox
  • geysermc:one_fun_example
If this identifier is referencing anything not in the vanilla Minecraft game, the namespace cannot be "minecraft". Further, paths cannot contain colons (:).
Since:
2.9.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The namespace for Minecraft.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    static Identifier
    of(@NonNull String namespace, @NonNull String path)
    Attempts to create a new identifier from a namespace and path.
    static Identifier
    of(String identifier)
    Attempts to create a new identifier from a string representation.
     
    default boolean
    Checks whether this identifier is using the "minecraft" namespace.
  • Field Details

  • Method Details

    • of

      static Identifier of(@NonNull String namespace, @NonNull String path)
      Attempts to create a new identifier from a namespace and path.
      Returns:
      the identifier for this namespace and path
      Throws:
      IllegalArgumentException - if either namespace or path are invalid.
      Since:
      2.9.0
    • of

      static Identifier of(String identifier)
      Attempts to create a new identifier from a string representation.
      Returns:
      the identifier for this namespace and path
      Throws:
      IllegalArgumentException - if either the namespace or path are invalid
      Since:
      2.9.0
    • namespace

      String namespace()
      Returns:
      the namespace of this identifier.
      Since:
      2.9.0
    • path

      String path()
      Returns:
      the path of this identifier.
      Since:
      2.9.0
    • vanilla

      default boolean vanilla()
      Checks whether this identifier is using the "minecraft" namespace.
      Since:
      2.9.0