Interface BlockNBTComponent
- All Superinterfaces:
Component, ComponentBuilderApplicable, ComponentLike, HoverEventSource<Component>, NBTComponent<BlockNBTComponent>, ScopedComponent<BlockNBTComponent>, StyleGetter, StyleSetter<Component>
public sealed interface BlockNBTComponent
extends NBTComponent<BlockNBTComponent>, ScopedComponent<BlockNBTComponent>
Given an in-game position, this component reads the NBT of the associated block and displays that information.
This component consists of:
- pos
- a position in the world the component is being displayed in.
- everything in
NBTComponent
- Since:
- 4.0.0
- See Also:
- Since Minecraft:
- 1.14
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn NBT component builder.static interfaceA local position.static interfaceA position.static interfaceA world position. -
Field Summary
Fields inherited from interface Component
EQUALS, EQUALS_IDENTITY, IS_NOT_EMPTYFields inherited from interface NBTComponent
INTERPRET_DEFAULT, PLAIN_DEFAULT -
Method Summary
Modifier and TypeMethodDescriptiondefault BlockNBTComponentabsoluteWorldPos(int x, int y, int z) Sets the block position to an absoluteBlockNBTComponent.WorldPoswith the given coordinates.default BlockNBTComponentlocalPos(double left, double up, double forwards) Sets the block position to aBlockNBTComponent.LocalPoswith the given coordinates.pos()Gets the block position.pos(BlockNBTComponent.Pos pos) Sets the block position.default BlockNBTComponentrelativeWorldPos(int x, int y, int z) Sets the block position to an relativeBlockNBTComponent.WorldPoswith the given coordinates.Returns a builder for this component.default BlockNBTComponentworldPos(BlockNBTComponent.WorldPos.Coordinate x, BlockNBTComponent.WorldPos.Coordinate y, BlockNBTComponent.WorldPos.Coordinate z) Sets the block position to aBlockNBTComponent.WorldPoswith the given coordinates.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 NBTComponent
interpret, interpret, nbtPath, nbtPath, plain, plain, separator, separatorMethods 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
-
pos
-
pos
Sets the block position.- Parameters:
pos- the block position- Returns:
- a block NBT component
- Since:
- 4.0.0
-
localPos
Sets the block position to aBlockNBTComponent.LocalPoswith the given coordinates.- Parameters:
left- the left coordinateup- the up coordinateforwards- the forwards coordinate- Returns:
- a block NBT component
- Since:
- 4.0.0
-
worldPos
@Contract(pure=true) default BlockNBTComponent worldPos(BlockNBTComponent.WorldPos.Coordinate x, BlockNBTComponent.WorldPos.Coordinate y, BlockNBTComponent.WorldPos.Coordinate z) Sets the block position to aBlockNBTComponent.WorldPoswith the given coordinates.- Parameters:
x- the x coordinatey- the y coordinatez- the z coordinate- Returns:
- a block NBT component
- Since:
- 4.0.0
-
absoluteWorldPos
Sets the block position to an absoluteBlockNBTComponent.WorldPoswith the given coordinates.- Parameters:
x- the x coordinatey- the y coordinatez- the z coordinate- Returns:
- a block NBT component
- Since:
- 4.0.0
-
relativeWorldPos
Sets the block position to an relativeBlockNBTComponent.WorldPoswith the given coordinates.- Parameters:
x- the x coordinatey- the y coordinatez- the z coordinate- Returns:
- a block NBT component
- Since:
- 4.0.0
-
toBuilder
BlockNBTComponent.Builder toBuilder()Description copied from interface:ComponentReturns a builder for this component.- Specified by:
toBuilderin interfaceComponent- Specified by:
toBuilderin interfaceNBTComponent<BlockNBTComponent>- Specified by:
toBuilderin interfaceScopedComponent<BlockNBTComponent>- Returns:
- the builder
-