ComponentBuilder
A builder interface for creating and manipulating Adventure text components. Provides fluent API methods for appending content, styling, and collecting components.
Properties
Extension property to append this string directly to the component builder. Provides a convenient property-style syntax for appending strings.
Extension property to append this string as a keybind component. Uses this string as the keybind key to display the player's configured key.
Extension property to append this string as a selector component. Uses this string as the entity selector pattern (@a, @p, etc.).
Extension property to append this string as a translatable component. Uses this string as the translation key for localized text.
Functions
Appends a string content to this component builder.
Appends a component to this component builder.
Sets the text color to aqua.
Sets the text color to black.
Appends a block NBT component with the specified NBT path and builder configuration. Queries and displays NBT data from a block at a specific position.
Sets the text color to blue.
Sets the bold decoration of the last component added to this ComponentBuilder.
Collects all appended components into a single component without a separator.
Collects all appended components into a single component with a string separator.
Collects all appended components into a single component with a component separator.
Creates a new component builder scope with the given consumer.
Sets the text color to dark aqua.
Sets the text color to dark blue.
Sets the text color to dark gray.
Sets the text color to dark green.
Sets the text color to dark purple.
Sets the text color to dark red.
Appends an entity NBT component with the specified NBT path and builder configuration. Queries and displays NBT data from entities matching a selector.
Iterates over the given iterable and applies an action to each element. The action receives both the component builder context and the current element, allowing component building per iteration.
Sets the text color to gold.
Sets the text color to gray.
Sets the text color to green.
Applies a hover event to the last appended component. When the player hovers over this component, the specified hover event will be triggered.
Sets the insertion text for the last appended component. When the player shift-clicks this component, the specified text will be inserted into their chat input field.
Sets the italic decoration of the last component added to this ComponentBuilder.
Joins all appended components into a single component without a separator.
Joins all appended components into a single component using a join configuration DSL.
Joins all appended components into a single component with a string separator.
Joins all appended components into a single component with a component separator.
Joins all appended components into a single component using a join configuration.
Creates a new component join configuration using a DSL builder.
Appends a keybind component with the specified keybind key. Displays the key binding configured by the player (e.g., "key.inventory", "key.jump").
Appends a keybind component with the specified keybind key and applies additional configuration.
Appends a MiniMessage string content to this component builder with optional tag resolvers.
Appends a MiniMessage string content to this component builder with tag resolvers built using a consumer.
Appends a newline component to this component builder. Inserts a line break in the text display.
Sets the obfuscated decoration of the last component added to this ComponentBuilder.
Sets the text color to light purple.
Sets the text color to red.
Appends a score component with the specified player name and objective.
Appends a score component with the specified player name and objective and applies additional configuration.
Appends a selector component with the specified selector pattern. Selectors target entities in the game world (e.g., "@a" for all players, "@p" for nearest player, "@etype=cow" for cows).
Appends a selector component with the specified selector pattern and applies additional configuration.
Appends a space component to this component builder. Inserts a single space character in the text display.
Appends a storage NBT component that queries data from command storage. Displays NBT data from persistent command storage at the specified key (parsed from string).
Appends a storage NBT component that queries data from command storage. Displays NBT data from persistent command storage at the specified key.
Sets the strikethrough decoration of the last component added to this ComponentBuilder.
Applies a style to the most recently appended component in this component builder. This allows retroactive styling of the last added component.
Appends a tab component to this component builder.
Appends a text component with the specified string content.
Appends a text component with the specified string content and applies additional configuration. This method combines appending text with a nested component builder scope, allowing you to build complex component hierarchies in a fluent way.
Appends a translatable component with the specified translation key.
Appends a translatable component with component arguments. The arguments will be substituted into the translation pattern.
Appends a translatable component with arguments built using a consumer lambda.
Appends a translatable component with the specified translation key and a list of component arguments.
Appends a translatable component with the specified translation key and style.
Appends a styled translatable component with arguments built using a nested component builder scope.
Appends a translatable component with the specified translation key, style, and list of arguments.
Appends a translatable component with the specified translation key, style, and component arguments.
Appends a translatable component with mixed type arguments. Accepts any type of arguments (String, Number, Component, etc.) which will be converted appropriately.
Operator function to append a string to this component builder using the unary + operator.
Operator function to append a component to this component builder using the unary + operator.
Sets the underline decoration of the last component added to this ComponentBuilder.
Conditionally applies a consumer lambda to this component builder if the condition is false.
Conditionally applies a consumer lambda to this component builder if the condition is true.
Sets the text color to white.
Sets the color of the last component added to this ComponentBuilder using an integer RGB value.
Sets the color of the last component added to this ComponentBuilder.
Sets the font of the last component added to this ComponentBuilder using a font key string.
Sets the font of the last component added to this ComponentBuilder.
Applies a style to the last component added to this ComponentBuilder using a DSL builder pattern.
Sets the text color to yellow.