Skip to main content

Module component

Module component 

Source
Expand description

Data model for Minecraft text components.

The types in this module represent the component schema shared by JSON and NBT text component encodings.

Re-exports§

pub use crate::basic::Uuid;

Structs§

CommandString
A command string validated for use in a text component click event.
ComponentObject
A full text component object with content, style, and appended components.
ComponentSequence
A non-empty list shorthand for a sequence of text components.
EmptyComponentSequence
Error returned when an empty list is converted into a ComponentSequence.
HttpUrl
A validated absolute HTTP or HTTPS URL used by an open_url click event.
InvalidCommandString
Error returned when a command contains a character forbidden by Minecraft.
InvalidHttpUrl
Error returned when an open_url value is not an absolute HTTP or HTTPS URL.
InvalidPlayerName
Error returned when a string is not a valid PlayerName.
InvalidResourceLocation
Error returned when a string is not a valid ResourceLocation.
InvalidRgbColor
Error returned when an RGB value does not fit in 24 bits.
InvalidUuid
Error returned when a UUID representation is malformed.
PlayerName
A validated Java Edition player name.
PositiveI32
A strictly positive signed 32-bit integer.
Profile
Player profile data used to render a player object.
ProfileProperty
A property attached to a player profile.
ResourceLocation
A validated Minecraft resource location.
RgbColor
A 24-bit red, green, and blue color.
Score
A scoreboard holder and objective referenced by score content.
ShadowColor
A text shadow color stored as a packed 32-bit ARGB value.
Style
Optional formatting and interaction properties for a component.

Enums§

ClickEvent
An action performed when a styled component is clicked.
Component
The Java Edition text component schema documented for the current protocol.
Content
The mutually exclusive content payload of a ComponentObject.
DialogReference
A reference to a registered dialog or an inline dialog definition.
HoverEvent
Content shown when a styled component is hovered.
InvalidComponentObject
Describes why a serialized component object does not match the component schema.
NamedColor
A predefined Minecraft text color.
NbtDisplay
Controls how values extracted from NBT are rendered.
NbtTarget
The source queried by an NBT component.
ObjectContent
The object rendered by object content.
PlayerModel
The geometry used to render a player skin.
PlayerProfile
The shorthand or full representation of a player profile.
ProfilePropertyName
A supported player profile property name.
TextColor
A named Minecraft color or an explicit 24-bit RGB color.

Constants§

TEXT_COMPONENT_FORMAT_VERSION
Java Edition release whose text component schema is represented here.

Type Aliases§

JsonComponent
A text component whose dynamic payloads use JSON values.
NbtComponent
A text component whose dynamic payloads use NBT values.