Record Class PlayerSkin

java.lang.Object
java.lang.Record
net.minestom.server.entity.PlayerSkin

public record PlayerSkin(String textures, String signature) extends Record
Contains all the data required to store a skin.

Can be applied to a player with Player.setSkin(PlayerSkin) or in the linked event PlayerSkinInitEvent.

  • Constructor Details

    • PlayerSkin

      public PlayerSkin(String textures, String signature)
      Creates an instance of a PlayerSkin record class.
      Parameters:
      textures - the value for the textures record component
      signature - the value for the signature record component
  • Method Details

    • fromUuid

      @Blocking @Nullable public static @Nullable PlayerSkin fromUuid(@NotNull @NotNull String uuid)
      Gets a skin from a Mojang UUID.
      Parameters:
      uuid - Mojang UUID
      Returns:
      a player skin based on the UUID, null if not found
    • fromUsername

      @Blocking @Nullable public static @Nullable PlayerSkin fromUsername(@NotNull @NotNull String username)
      Gets a skin from a Minecraft username.
      Parameters:
      username - the Minecraft username
      Returns:
      a skin based on a Minecraft username, null if not found
    • getTextures

      @Deprecated public String getTextures()
      Deprecated.
    • getSignature

      @Deprecated public String getSignature()
      Deprecated.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • textures

      public String textures()
      Returns the value of the textures record component.
      Returns:
      the value of the textures record component
    • signature

      public String signature()
      Returns the value of the signature record component.
      Returns:
      the value of the signature record component