- 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 interface
Represents any type which can hold data components.static final record
Nested classes/interfaces inherited from interface net.minestom.server.codec.Codec
Codec.RawValue
Nested classes/interfaces inherited from interface net.minestom.server.registry.Holder
Holder.Direct<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec
<DataComponent<?>> static final Codec
<DataComponentMap> static final NetworkBuffer.Type
<DataComponentMap> static final NetworkBuffer.Type
<DataComponent<?>> static final 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, COMPONENT_STYLE, DOUBLE, FLOAT, INT, INT_ARRAY, KEY, LONG, LONG_ARRAY, NBT, NBT_COMPOUND, RAW_VALUE, SHORT, STRING, UNIT, UUID, UUID_COERCED, UUID_STRING, VECTOR3D
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> DataComponent
<T> createHeadless
(int id, 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
(net.kyori.adventure.key.Key key) boolean
boolean
isSynced()
read
(NetworkBuffer reader) static Collection
<DataComponent<?>> values()
void
write
(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, unionType
Methods inherited from interface net.minestom.server.registry.Holder
asKey, asValue, isDirect, resolve, unwrap
Methods 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
-
fromId
-
values
-
createHeadless
@Internal static <T> DataComponent<T> createHeadless(int id, net.kyori.adventure.key.Key key, @Nullable NetworkBuffer.Type<T> network, @Nullable @Nullable Codec<T> codec)
-