Skip to content

Class endstone::Dimension

ClassList > endstone > Dimension

Represents a dimension within a Level .

  • #include <endstone/level/dimension.h>

Inherits the following classes: std::enable_shared_from_this< Dimension >

Public Static Attributes

Type Name
constexpr auto Nether = [**DimensionId::minecraft**](classendstone_1_1Identifier.md#function-minecraft)("nether")
constexpr auto Overworld = [**DimensionId::minecraft**](classendstone_1_1Identifier.md#function-minecraft)("overworld")
constexpr auto TheEnd = [**DimensionId::minecraft**](classendstone_1_1Identifier.md#function-minecraft)("the\_end")

Public Functions

Type Name
virtual Item & dropItem (Location location, const ItemStack & item) = 0
Drops an item at the specified Location .
virtual std::vector< Actor * > getActors () const = 0
Get a list of all actors in this dimension.
virtual std::unique_ptr< Block > getBlockAt (int x, int y, int z) const = 0
Gets the Block at the given coordinates.
virtual std::unique_ptr< Block > getBlockAt (Location location) const = 0
Gets the Block at the givenLocation .
virtual std::unique_ptr< Block > getHighestBlockAt (int x, int z) const = 0
Gets the highest non-empty (impassable) block at the given coordinates.
virtual std::unique_ptr< Block > getHighestBlockAt (Location location) const = 0
Gets the highest non-empty (impassable) block at the given Location .
virtual int getHighestBlockYAt (int x, int z) const = 0
Gets the highest non-empty (impassable) coordinate at the given coordinates.
virtual DimensionId getId () const = 0
Return the identifier of this dimension.
virtual Level & getLevel () const = 0
Gets the level to which this dimension belongs.
virtual std::vector< std::unique_ptr< Chunk > > getLoadedChunks () = 0
Gets a list of all loaded Chunks.
virtual std::string getTranslationKey () const = 0
Get the translation key, suitable for use in a translation component.
virtual bool isChunkLoaded (int x, int z) const = 0
Checks if the Chunk at the given coordinates is loaded.
virtual bool isValid () const = 0
Checks whether this dimension is still valid (loaded).
virtual bool loadChunk (int x, int z) = 0
Requests the Chunk at the given coordinates to be loaded, and keeps it loaded until it is unloaded again.
virtual Actor * spawnActor (Location location, ActorTypeId type) = 0
Creates an actor at the given Location .
virtual bool unloadChunk (int x, int z) = 0
Releases the plugin-owned ticket that loadChunk() placed on theChunk at the given coordinates.
virtual ~Dimension () = default

Public Static Attributes Documentation

variable Nether

constexpr auto endstone::Dimension::Nether;

variable Overworld

constexpr auto endstone::Dimension::Overworld;

variable TheEnd

constexpr auto endstone::Dimension::TheEnd;

Public Functions Documentation

function dropItem

Drops an item at the specified Location .

virtual Item & endstone::Dimension::dropItem (
    Location location,
    const  ItemStack & item
) = 0

Parameters:

Returns:

Item entity created as a result of this method


function getActors

Get a list of all actors in this dimension.

virtual std::vector< Actor * > endstone::Dimension::getActors () const = 0

Returns:

A List of all actors currently residing in this dimension


function getBlockAt [½]

Gets the Block at the given coordinates.

virtual std::unique_ptr< Block > endstone::Dimension::getBlockAt (
    int x,
    int y,
    int z
) const = 0

Parameters:

  • x X-coordinate of the block
  • y Y-coordinate of the block
  • z Z-coordinate of the block

Returns:

Block at the given coordinates


function getBlockAt [2/2]

Gets the Block at the givenLocation .

virtual std::unique_ptr< Block > endstone::Dimension::getBlockAt (
    Location location
) const = 0

Parameters:

Returns:

Block at the given coordinates


function getHighestBlockAt [½]

Gets the highest non-empty (impassable) block at the given coordinates.

virtual std::unique_ptr< Block > endstone::Dimension::getHighestBlockAt (
    int x,
    int z
) const = 0

Parameters:

  • x X-coordinate of the block
  • z Z-coordinate of the block

Returns:

Highest non-empty block


function getHighestBlockAt [2/2]

Gets the highest non-empty (impassable) block at the given Location .

virtual std::unique_ptr< Block > endstone::Dimension::getHighestBlockAt (
    Location location
) const = 0

Parameters:

  • location Coordinates to get the highest block

Returns:

Highest non-empty block


function getHighestBlockYAt

Gets the highest non-empty (impassable) coordinate at the given coordinates.

virtual int endstone::Dimension::getHighestBlockYAt (
    int x,
    int z
) const = 0

Parameters:

  • x X-coordinate of the blocks
  • z Z-coordinate of the blocks

Returns:

Y-coordinate of the highest non-empty block


function getId

Return the identifier of this dimension.

virtual DimensionId endstone::Dimension::getId () const = 0

Returns:

this dimension's identifier


function getLevel

Gets the level to which this dimension belongs.

virtual Level & endstone::Dimension::getLevel () const = 0

Returns:

Level containing this dimension.


function getLoadedChunks

Gets a list of all loaded Chunks.

virtual std::vector< std::unique_ptr< Chunk > > endstone::Dimension::getLoadedChunks () = 0

Returns:

All loaded chunks


function getTranslationKey

Get the translation key, suitable for use in a translation component.

virtual std::string endstone::Dimension::getTranslationKey () const = 0

Returns:

the translation key


function isChunkLoaded

Checks if the Chunk at the given coordinates is loaded.

virtual bool endstone::Dimension::isChunkLoaded (
    int x,
    int z
) const = 0

Parameters:

  • x X-coordinate of the chunk
  • z Z-coordinate of the chunk

Returns:

true if the chunk is loaded, otherwise false


function isValid

Checks whether this dimension is still valid (loaded).

virtual bool endstone::Dimension::isValid () const = 0

A Dimension handle can outlive the underlying dimension if it is unloaded; this returns false once that happens, after which accessing the dimension throws.

Returns:

true if the dimension is still loaded, false otherwise


function loadChunk

Requests the Chunk at the given coordinates to be loaded, and keeps it loaded until it is unloaded again.

virtual bool endstone::Dimension::loadChunk (
    int x,
    int z
) = 0

Unlike Java Edition, Bedrock has no synchronous chunk load: this registers a plugin-owned ticking ticket for the chunk, which is honoured on the next server tick (so the chunk may not be available within this call). The chunk is then kept loaded and ticking until removed with unloadChunk(), the server restarts, or the ticket limit is reached. Intended for keeping a handful of chunks resident; it is not suited to loading large regions.

Parameters:

  • x X-coordinate of the chunk
  • z Z-coordinate of the chunk

Returns:

true if the ticket was registered (or already present), otherwise false


function spawnActor

Creates an actor at the given Location .

virtual Actor * endstone::Dimension::spawnActor (
    Location location,
    ActorTypeId type
) = 0

Parameters:

  • location The location to spawn the actor
  • type The actor type to spawn

Returns:

Resulting Actor of this method


function unloadChunk

Releases the plugin-owned ticket that loadChunk() placed on theChunk at the given coordinates.

virtual bool endstone::Dimension::unloadChunk (
    int x,
    int z
) = 0

This only removes Endstone's own ticket; it never affects /tickingareas or other holders. The chunk is unloaded once nothing else keeps it loaded (a nearby player, the spawn area, etc.), so this is a no-op in effect while the chunk is still in use.

Parameters:

  • x X-coordinate of the chunk
  • z Z-coordinate of the chunk

Returns:

true once the ticket has been released


function ~Dimension

virtual endstone::Dimension::~Dimension () = default


The documentation for this class was generated from the following file include/endstone/level/dimension.h