Interface GeyserEntityDataType<T>

Type Parameters:
T - the value type associated with this entity data type
All Known Subinterfaces:
GeyserListEntityDataType<T>

public interface GeyserEntityDataType<T>
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 custom items or blocks, it is possible to update entity metadata at runtime, which can be done using GeyserEntity.update(GeyserEntityDataType, Object).

Since:
2.11.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the unique name of this data type.
    static <T> GeyserEntityDataType<T>
    of(Class<T> typeClass, String name)
    For API usage only; use the types defined in GeyserEntityDataTypes
    Gets the Java class representing the value type associated with this data type.
  • Method Details

    • typeClass

      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
    • name

      String name()
      Gets the unique name of this data type.

      The name is used internally to identify and register the data type so it can be referenced when reading or writing entity metadata.

      Returns:
      the name of this entity data type
      Since:
      2.11.0
    • of

      static <T> GeyserEntityDataType<T> of(Class<T> typeClass, String name)
      For API usage only; use the types defined in GeyserEntityDataTypes