Interface NbtComponentSerializer
- All Superinterfaces:
net.kyori.adventure.text.serializer.ComponentDecoder<Object,,net.kyori.adventure.text.Component> net.kyori.adventure.text.serializer.ComponentEncoder<net.kyori.adventure.text.Component,,Object> net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.Component, Object>
public interface NbtComponentSerializer
extends net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.Component,Object>
This serializer serializes and deserializes
Components to and from NBT tags represented using Cloudburst's NBT library.
The serializer supports all modern component, click, and hover event types. It does not support serializing and deserializing older component formats - only the latest Minecraft version is supported. Implementation notes are as follows:
- The serializer implements
DialogLiketo deserialize"show_dialog"click events. The implementation can be found atNbtDialog. It is a simple implementation, only holding theKeyreference to a dialog, or the inline-defined the dialog, serialized asNbtMap. The serializer can only ever serialize"show_dialog"click events with aNbtDialogDialogLikeimplementation, it will throwIllegalArgumentExceptionfor other implementations. - The serializer implements
DataComponentValueto deserialize"show_item"hover events. The implementation can be found atNbtDataComponentValue. It is a simple implementation, only holding the raw value of the data component, serialized to NBT, represented as anObject. Note that the serializer usesDataComponentValue.removed()to represent removed data components. The serializer can only ever serialize"show_item"hover events withNbtDataComponentValueDataComponentValues, it will throwIllegalArgumentExceptionfor other implementations. - The serializer does not implement the deserializing and serializing of payloads of
"custom"click events. It will silently drop any that are found.
- See Also:
-
Method Summary
Static MethodsMethods inherited from interface net.kyori.adventure.text.serializer.ComponentSerializer
deserialize, deserializeOr, deserializeOrNull, serialize, serializeOr, serializeOrNull
-
Method Details
-
nbt
-