Interface ObjectComponent
- All Superinterfaces:
Component, ComponentBuilderApplicable, ComponentLike, HoverEventSource<Component>, ScopedComponent<ObjectComponent>, StyleGetter, StyleSetter<Component>
Displays a non-text object.
- Since:
- 4.25.0
- Since Minecraft:
- 1.21.9
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn object component builder. -
Field Summary
Fields inherited from interface Component
EQUALS, EQUALS_IDENTITY, IS_NOT_EMPTY -
Method Summary
Modifier and TypeMethodDescriptioncontents()Gets the contents of this object component.contents(ObjectContents contents) Creates a copy of this object component with the given contents.@Nullable Componentfallback()Gets the fallback component.fallback(@Nullable ComponentLike fallback) Creates a copy of this object component with the given fallback.Returns a builder for this component.Methods inherited from interface Component
asHoverEvent, children, clickEvent, color, compact, compact, componentBuilderApply, contains, contains, decoration, decorations, font, hasDecoration, hasStyling, hoverEvent, insertion, iterable, iterable, iterator, iterator, replaceText, replaceText, shadowColor, spliterator, spliterator, styleMethods inherited from interface HoverEventSource
asHoverEventMethods inherited from interface ScopedComponent
append, append, append, append, append, appendNewline, appendSpace, applyFallbackStyle, applyFallbackStyle, asComponent, children, clickEvent, color, colorIfAbsent, decorate, decoration, decoration, decorationIfAbsent, decorations, font, hoverEvent, insertion, mergeStyle, mergeStyle, mergeStyle, shadowColor, shadowColorIfAbsent, style, style, style, styleMethods inherited from interface StyleSetter
decorate, decorations
-
Method Details
-
contents
ObjectContents contents()Gets the contents of this object component.- Returns:
- the contents
- Since:
- 4.25.0
-
contents
Creates a copy of this object component with the given contents.- Parameters:
contents- the contents to set- Returns:
- new object component
- Since:
- 4.25.0
-
fallback
@Nullable Component fallback()Gets the fallback component.The client displays this instead of this component in areas where object components are not supported, such as server MOTDs.
- Returns:
- the fallback component, if any
- Since:
- 5.0.0
- Since Minecraft:
- 26.1
-
fallback
Creates a copy of this object component with the given fallback.The client displays this instead of this component in areas where object components are not supported, such as server MOTDs.
- Parameters:
fallback- the fallback component, ornullto clear the fallback- Returns:
- the new object component
- Since:
- 5.0.0
- Since Minecraft:
- 26.1
-
toBuilder
ObjectComponent.Builder toBuilder()Description copied from interface:ComponentReturns a builder for this component.- Specified by:
toBuilderin interfaceComponent- Specified by:
toBuilderin interfaceScopedComponent<ObjectComponent>- Returns:
- the builder
-