Interface DataComponent<T>

Type Parameters:
T - The value type of the component
All Superinterfaces:
net.kyori.adventure.key.Keyed, ProtocolObject, StaticProtocolObject

public sealed interface DataComponent<T> extends StaticProtocolObject
A common type to represent all forms of component in the game. Each group of component types has its own declaration file (see ItemComponent for example).
See Also:
  • Method Details

    • isSynced

      boolean isSynced()
    • isSerialized

      boolean isSerialized()
    • read

      @NotNull T read(@NotNull BinaryTagSerializer.Context context, @NotNull @NotNull net.kyori.adventure.nbt.BinaryTag tag)
    • write

      @NotNull @NotNull net.kyori.adventure.nbt.BinaryTag write(@NotNull BinaryTagSerializer.Context context, @NotNull T value)
    • read

      @NotNull T read(@NotNull @NotNull NetworkBuffer reader)
    • write

      void write(@NotNull @NotNull NetworkBuffer writer, @NotNull T value)
    • createHeadless

      @Internal static <T> DataComponent<T> createHeadless(int id, @NotNull @NotNull net.kyori.adventure.key.Key key, @Nullable NetworkBuffer.Type<T> network, @Nullable @Nullable BinaryTagSerializer<T> nbt)