Interface BlockNBTComponent

All Superinterfaces:
Buildable<BlockNBTComponent,​BlockNBTComponent.Builder>, BuildableComponent<BlockNBTComponent,​BlockNBTComponent.Builder>, Component, ComponentBuilderApplicable, ComponentLike, net.kyori.examination.Examinable, HoverEventSource<Component>, NBTComponent<BlockNBTComponent,​BlockNBTComponent.Builder>, ScopedComponent<BlockNBTComponent>

public interface BlockNBTComponent
extends NBTComponent<BlockNBTComponent,​BlockNBTComponent.Builder>, 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:
NBTComponent
Since Minecraft:
1.14
  • Method Details

    • pos

      @NonNull BlockNBTComponent.Pos pos()
      Gets the block position.
      Returns:
      the block position
      Since:
      4.0.0
    • pos

      @Contract(pure=true) @NonNull BlockNBTComponent pos​(@NonNull BlockNBTComponent.Pos pos)
      Sets the block position.
      Parameters:
      pos - the block position
      Returns:
      a block NBT component
      Since:
      4.0.0
    • localPos

      @Contract(pure=true) default @NonNull BlockNBTComponent localPos​(double left, double up, double forwards)
      Sets the block position to a BlockNBTComponent.LocalPos with the given coordinates.
      Parameters:
      left - the left coordinate
      up - the up coordinate
      forwards - the forwards coordinate
      Returns:
      a block NBT component
      Since:
      4.0.0
    • worldPos

      @Contract(pure=true) default @NonNull BlockNBTComponent worldPos​(@NonNull BlockNBTComponent.WorldPos.Coordinate x, @NonNull BlockNBTComponent.WorldPos.Coordinate y, @NonNull BlockNBTComponent.WorldPos.Coordinate z)
      Sets the block position to a BlockNBTComponent.WorldPos with the given coordinates.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      Returns:
      a block NBT component
      Since:
      4.0.0
    • absoluteWorldPos

      @Contract(pure=true) default @NonNull BlockNBTComponent absoluteWorldPos​(int x, int y, int z)
      Sets the block position to an absolute BlockNBTComponent.WorldPos with the given coordinates.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      Returns:
      a block NBT component
      Since:
      4.0.0
    • relativeWorldPos

      @Contract(pure=true) default @NonNull BlockNBTComponent relativeWorldPos​(int x, int y, int z)
      Sets the block position to an relative BlockNBTComponent.WorldPos with the given coordinates.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      Returns:
      a block NBT component
      Since:
      4.0.0