Package net.minestom.server.component
Interface DataComponent<T>
- Type Parameters:
T
- The value type of the component
- All Superinterfaces:
net.kyori.adventure.key.Keyed
,ProtocolObject
,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:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Represents any type which can hold data components. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> DataComponent
<T> createHeadless
(int id, @NotNull NamespaceID namespace, NetworkBuffer.Type<T> network, @Nullable BinaryTagSerializer<T> nbt) boolean
boolean
isSynced()
read
(@NotNull NetworkBuffer reader) read
(BinaryTagSerializer.Context context, @NotNull net.kyori.adventure.nbt.BinaryTag tag) void
write
(@NotNull NetworkBuffer writer, T value) @NotNull net.kyori.adventure.nbt.BinaryTag
write
(BinaryTagSerializer.Context context, T value) Methods inherited from interface net.minestom.server.registry.ProtocolObject
registry
Methods inherited from interface net.minestom.server.registry.StaticProtocolObject
id, key, name, namespace
-
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
-
write
-
createHeadless
@Internal static <T> DataComponent<T> createHeadless(int id, @NotNull @NotNull NamespaceID namespace, @Nullable NetworkBuffer.Type<T> network, @Nullable @Nullable BinaryTagSerializer<T> nbt)
-