Interface StyleSetter<T extends StyleSetter<?>>
- Type Parameters:
T- the type implementing this interface, e.g.Component
- All Known Subinterfaces:
BlockNBTComponent, BlockNBTComponent.Builder, Component, ComponentBuilder<C,B>, EntityNBTComponent, EntityNBTComponent.Builder, KeybindComponent, KeybindComponent.Builder, MutableStyleSetter<T>, NBTComponent<C>, NBTComponentBuilder<C, B>, ObjectComponent, ObjectComponent.Builder, ScopedComponent<C>, ScoreComponent, ScoreComponent.Builder, SelectorComponent, SelectorComponent.Builder, StorageNBTComponent, StorageNBTComponent.Builder, Style, Style.Builder, TextComponent, TextComponent.Builder, TranslatableComponent, TranslatableComponent.Builder, VirtualComponent
@NonExtendable
public interface StyleSetter<T extends StyleSetter<?>>
Writes style properties to an object.
- Since:
- 4.10.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclickEvent(@Nullable ClickEvent<?> event) Sets the click event.Sets the color.colorIfAbsent(@Nullable TextColor color) Sets the color if there isn't one set already.default Tdecorate(TextDecoration decoration) Sets the state ofdecorationtoTextDecoration.State.TRUE.default Tdecorate(TextDecoration... decorations) SetsdecorationstoTextDecoration.State.TRUE.default Tdecoration(TextDecoration decoration, boolean flag) Sets the state of a decoration.decoration(TextDecoration decoration, TextDecoration.State state) Sets the value of a decoration.decorationIfAbsent(TextDecoration decoration, TextDecoration.State state) Sets the state of a decoration tostateif the current state of the decoration isTextDecoration.State.NOT_SET.decorations(Map<TextDecoration, TextDecoration.State> decorations) Sets decorations using the specifieddecorationsmap.default Tdecorations(Set<TextDecoration> decorations, boolean flag) Sets the state of a set of decorations toflag.Sets the font.hoverEvent(@Nullable HoverEventSource<?> source) Sets the hover event.Sets the string to be inserted when this object (T) is shift-clicked.shadowColor(@Nullable ARGBLike argb) Sets the shadow color.shadowColorIfAbsent(@Nullable ARGBLike argb) Sets the shadow color if there isn't one set already.
-
Method Details
-
font
-
color
-
colorIfAbsent
-
shadowColor
Sets the shadow color.Setting the color to
nullwill reset the shadow color to default. To remove the shadow entirely, useShadowColor.none().- Parameters:
argb- the color- Returns:
- an object (
T) - Since:
- 4.18.0
-
shadowColorIfAbsent
Sets the shadow color if there isn't one set already.Setting the color to
nullwill reset the shadow color to default. To remove the shadow entirely, useShadowColor.none().- Parameters:
argb- the color- Returns:
- an object (
T) - Since:
- 4.18.0
-
decorate
Sets the state ofdecorationtoTextDecoration.State.TRUE.- Parameters:
decoration- the decoration- Returns:
- an object (
T) - Since:
- 4.10.0
-
decorate
SetsdecorationstoTextDecoration.State.TRUE.- Parameters:
decorations- the decorations- Returns:
- an object (
T) - Since:
- 4.10.0
-
decoration
Sets the state of a decoration.- Parameters:
decoration- the decorationflag-trueif this object should have the decoration,falseif this object should not have the decoration- Returns:
- an object (
T) - Since:
- 4.10.0
-
decoration
Sets the value of a decoration.- Parameters:
decoration- the decorationstate-TextDecoration.State.TRUEif this object should have the decoration,TextDecoration.State.FALSEif this object should not have the decoration, andTextDecoration.State.NOT_SETif the decoration should not have a set value- Returns:
- an object (
T) - Since:
- 4.10.0
-
decorationIfAbsent
Sets the state of a decoration tostateif the current state of the decoration isTextDecoration.State.NOT_SET.- Parameters:
decoration- the decorationstate- the state- Returns:
- an object (
T) - Since:
- 4.12.0
-
decorations
Sets decorations using the specifieddecorationsmap.If a given decoration does not have a value explicitly set, the value of that particular decoration is not changed.
- Parameters:
decorations- the decorations- Returns:
- an object (
T) - Since:
- 4.10.0
-
decorations
Sets the state of a set of decorations toflag.- Parameters:
decorations- the decorationsflag-trueif this builder should have the decorations,falseif this builder should not have the decorations- Returns:
- an object (
T) - Since:
- 4.10.0
-
clickEvent
Sets the click event.- Parameters:
event- the click event- Returns:
- an object (
T) - Since:
- 4.10.0
-
hoverEvent
Sets the hover event.- Parameters:
source- the hover event source- Returns:
- an object (
T) - Since:
- 4.10.0
-
insertion
-