Package net.minestom.server.component
Interface DataComponent<T>
- Type Parameters:
T- The value type of the component
- All Superinterfaces:
Codec<T>,Decoder<T>,Encoder<T>,Holder<DataComponent<T>>,net.kyori.adventure.key.Keyed,RegistryKey<DataComponent<T>>,StaticProtocolObject<DataComponent<T>>
A common type to represent all forms of component in the game. Each group of component types has its own declaration
file (see
DataComponent for example).- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents any type which can hold data components.static final recordNested classes/interfaces inherited from interface net.minestom.server.codec.Codec
Codec.RawValueNested classes/interfaces inherited from interface net.minestom.server.registry.Holder
Holder.Direct<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NotNull Codec<DataComponent<?>> static final @NotNull Codec<DataComponentMap> static final NetworkBuffer.Type<DataComponentMap> static final NetworkBuffer.Type<DataComponent<?>> static final @NotNull Codec<DataComponentMap> static final NetworkBuffer.Type<DataComponentMap> static final NetworkBuffer.Type<DataComponentMap> Fields inherited from interface net.minestom.server.codec.Codec
BLOCK_POSITION, BOOLEAN, BYTE, BYTE_ARRAY, COMPONENT, DOUBLE, FLOAT, INT, INT_ARRAY, KEY, LONG, LONG_ARRAY, NBT, NBT_COMPOUND, RAW_VALUE, SHORT, STRING, UNIT, UUID, UUID_COERCED, VECTOR3D -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> DataComponent<T> createHeadless(int id, @NotNull net.kyori.adventure.key.Key key, NetworkBuffer.Type<T> network, @Nullable Codec<T> codec) static @Nullable DataComponent<?> fromId(int id) static @Nullable DataComponent<?> static @Nullable DataComponent<?> fromKey(@NotNull net.kyori.adventure.key.Key key) booleanbooleanisSynced()read(@NotNull NetworkBuffer reader) static @NotNull Collection<DataComponent<?>> values()voidwrite(@NotNull NetworkBuffer writer, T value) Methods inherited from interface net.minestom.server.codec.Codec
list, list, listOrSingle, listOrSingle, mapValue, mapValue, optional, optional, orElse, set, set, transform, unionType, unionTypeMethods inherited from interface net.minestom.server.registry.Holder
asKey, asValue, isDirect, resolve, unwrapMethods inherited from interface net.minestom.server.registry.StaticProtocolObject
id, key, name, registry
-
Field Details
-
NETWORK_TYPE
-
CODEC
-
MAP_NETWORK_TYPE
-
MAP_NBT_TYPE
-
PATCH_NETWORK_TYPE
-
UNTRUSTED_PATCH_NETWORK_TYPE
-
PATCH_CODEC
-
-
Method Details
-
isSynced
boolean isSynced() -
isSerialized
boolean isSerialized() -
read
-
write
-
fromKey
-
fromKey
@Nullable static @Nullable DataComponent<?> fromKey(@NotNull @NotNull net.kyori.adventure.key.Key key) -
fromId
-
values
-
createHeadless
@Internal static <T> DataComponent<T> createHeadless(int id, @NotNull @NotNull net.kyori.adventure.key.Key key, @Nullable NetworkBuffer.Type<T> network, @Nullable @Nullable Codec<T> codec)
-