Interface World


public interface World
Represents a world.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Represents a world builder.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull BlockState
    block(int x, int y, int z)
    Gets the block at the specified coordinates.
    void
    block(int x, int y, int z, @NotNull BlockState block)
    Sets the specified block at the specified coordinates.
    default @NotNull BlockState
    block(@NotNull Position position)
    Gets the block at the specified position.
    default void
    block(@NotNull Position position, @NotNull BlockState block)
    Sets the specified block at the specified coordinates.
    Creates a new world builder.
    @NotNull Chunk
    chunk(int chunkX, int chunkZ)
    Gets the chunk at the specified chunk coordinates.
    @NotNull Chunk
    chunkAt(int x, int z)
    Gets the chunk at the specified coordinates.
    @NotNull Chunk
    chunkAt(@NotNull Position position)
    Gets the chunk at the specified position.
    @NotNull GameMode
    Gets the default game mode of the world.
    @NotNull Dimension
    Gets the dimension of the world.
    Gets the extra world data.
    void
    Sets the extra data.
    Gets the chunk generator of the world.
    boolean
    Checks if the world is alive.
    @NotNull String
    Gets the name of the world.
    void
    save(@NotNull WorldSaver saver)
    Saves a world.
    void
    spawnEntity(@NotNull Entity entity, @NotNull Position position)
    Spawns the specified entity at the specified position in this world.
    @NotNull Position
    Gets the spawn position of the world.
  • Method Details

    • name

      @NotNull @NotNull String name()
      Gets the name of the world.
      Returns:
      the world's name
      Since:
      1.0.0
    • dimension

      @NotNull @NotNull Dimension dimension()
      Gets the dimension of the world.
      Returns:
      the world's dimension
      Since:
      1.0.0
    • generator

      @NotNull @NotNull ChunkGenerator generator()
      Gets the chunk generator of the world.
      Returns:
      the world's chunk generator
      Since:
      1.0.0
    • spawnPosition

      @NotNull @NotNull Position spawnPosition()
      Gets the spawn position of the world.
      Returns:
      the world's spawn position
      Since:
      1.0.0
    • defaultGameMode

      @NotNull @NotNull GameMode defaultGameMode()
      Gets the default game mode of the world.
      Returns:
      the world's default game mode
      Since:
      1.0.0
    • block

      void block(int x, int y, int z, @NotNull @NotNull BlockState block)
      Sets the specified block at the specified coordinates.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      block - the block to set
      Since:
      1.0.0
    • block

      default void block(@NotNull @NotNull Position position, @NotNull @NotNull BlockState block)
      Sets the specified block at the specified coordinates.
      Parameters:
      position - the position
      block - the block to set
      Since:
      1.0.0
    • block

      @NotNull @NotNull BlockState block(int x, int y, int z)
      Gets the block at the specified coordinates.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      Returns:
      the block at the specified coordinates
      Since:
      1.0.0
    • block

      @NotNull default @NotNull BlockState block(@NotNull @NotNull Position position)
      Gets the block at the specified position.
      Parameters:
      position - the position of the block
      Returns:
      the block at the specified position
      Since:
      1.0.0
    • chunk

      @NotNull @NotNull Chunk chunk(int chunkX, int chunkZ)
      Gets the chunk at the specified chunk coordinates.
      Parameters:
      chunkX - the chunk x coordinate
      chunkZ - the chunk z coordinate
      Returns:
      the chunk at the specified chunk coordinates
      Since:
      1.0.0
    • chunkAt

      @NotNull @NotNull Chunk chunkAt(int x, int z)
      Gets the chunk at the specified coordinates.
      Parameters:
      x - the x coordinate
      z - the z coordinate
      Returns:
      the chunk at the specified coordinates
      Since:
      1.0.0
    • chunkAt

      @NotNull @NotNull Chunk chunkAt(@NotNull @NotNull Position position)
      Gets the chunk at the specified position.
      Parameters:
      position - the position
      Returns:
      the chunk at the specified position
      Since:
      1.0.0
    • spawnEntity

      void spawnEntity(@NotNull @NotNull Entity entity, @NotNull @NotNull Position position)
      Spawns the specified entity at the specified position in this world.
      Parameters:
      entity - the entity to spawn
      position - the position
      Since:
      1.0.0
    • extraData

      @NotNull @NotNull CompoundBinaryTag extraData()
      Gets the extra world data. In the anvil folder it is the level dat file.
      Since:
      1.0.0
    • extraData

      void extraData(@NotNull @NotNull CompoundBinaryTag data)
      Sets the extra data.
      Parameters:
      data - the data in a compound binary tag
      Since:
      1.0.0
    • isAlive

      boolean isAlive()
      Checks if the world is alive.
      Returns:
      whether the world is alive
      Since:
      1.0.0
    • save

      void save(@NotNull @NotNull WorldSaver saver)
      Saves a world.
      Since:
      1.0.0
    • builder

      static World.Builder builder()
      Creates a new world builder.
      Returns:
      a new builder instance.
      Since:
      1.0.0