Interface WorldNarrator


public interface WorldNarrator
Provides narration for blocks and entities.
Since:
1.12.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    narrate(@NotNull net.minecraft.core.BlockPos block)
    Generates a description of a given block to be narrated.
    narrate(@NotNull net.minecraft.world.entity.Entity entity)
    Generates a description of a given entity to be narrated.
    narrate(@NotNull net.minecraft.world.phys.HitResult rayCast)
    Generates a description of the block or entity the player is currently looking at to be narrated.
    @Nullable net.minecraft.world.phys.HitResult
    Preforms a ray cast to determine what the player is looking at.
  • Method Details

    • rayCast

      @Contract(pure=true) @Nullable @Nullable net.minecraft.world.phys.HitResult rayCast()
      Preforms a ray cast to determine what the player is looking at.

      A value of null is equivalent to a HitResult with type HitResult.Type.MISS and indicates that the player is not looking at anything.

      Returns:
      A HitResult for what the player is looking at or null.
      Since:
      1.12.0
    • narrate

      @Contract(pure=true) @Nullable @Nullable String narrate(@NotNull @NotNull net.minecraft.world.phys.HitResult rayCast)
      Generates a description of the block or entity the player is currently looking at to be narrated.

      A value of null indicates that there is no narration available.

      Parameters:
      rayCast - Ray cast from rayCast().
      Returns:
      A string to be narrated to the player or null.
      Since:
      1.12.0
    • narrate

      @Contract(pure=true) @NotNull @NotNull String narrate(@NotNull @NotNull net.minecraft.core.BlockPos block)
      Generates a description of a given block to be narrated.
      Parameters:
      block - The block to narrate.
      Returns:
      A string to be narrated to the player.
      Since:
      1.12.0
    • narrate

      @Contract(pure=true) @NotNull @NotNull String narrate(@NotNull @NotNull net.minecraft.world.entity.Entity entity)
      Generates a description of a given entity to be narrated.
      Parameters:
      entity - The entity to narrate.
      Returns:
      A string to be narrated to the player.
      Since:
      1.12.0