Class GeyserEntityDataType<T>

java.lang.Object
org.geysermc.geyser.api.entity.data.GeyserEntityDataType<T>
Type Parameters:
T - the value type associated with this entity data type
Direct Known Subclasses:
GeyserListEntityDataType

@Experimental public abstract sealed class GeyserEntityDataType<T> extends Object permits GeyserListEntityDataType<T> (not exhaustive)
Represents a type of entity data that can be sent for an entity.

Entity data types define the values stored for a particular piece of metadata, such as a Byte, Integer, Float; and the name associated with the types.

Unlike properties of custom items or blocks, it is possible to update entity metadata at runtime, which can be done using GeyserEntity.update(GeyserEntityDataType, Object).

Only the built-in types in GeyserEntityDataTypes are supported. Attempting to use a type not provided by Geyser will throw an IllegalArgumentException at runtime.

Since:
2.11.0
  • Method Details

    • identifier

      public final Identifier identifier()
      Gets the identifier associated with this entity data type.
      Returns:
      the identifier for this type
      Since:
      2.11.0
    • typeClass

      public final Class<T> typeClass()
      Gets the Java class representing the value type associated with this data type.
      Returns:
      the class of the value used by this entity data type
      Since:
      2.11.0
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object