Interface Chunk<P extends Chunk<P>>

    • Method Detail

      • addEntity

        void addEntity​(Entity entity)
        Adds the Entity to this chunk. It is not guaranteed this will succeed in all cases, as state() does play a role in whether an entity can be directly added or not.

        This method should realistically be used only during world generation, and therefore will likely emit warnings if attempting to add entities to live WorldChunk instances.

        entity - The entity to add
      • state

        ChunkState state()
        Gets this Chunk's current ChunkState. The ChunkState stipulates the potential validity of various operations that can be performed.

        A fully generated chunk will return ChunkStates.FULL - though care should be taken as the chunk may be an empty one.

        This chunk's state
      • isEmpty

        boolean isEmpty()
        Gets whether this chunk is empty.
        Whether this chunk is empty
      • chunkPosition

        Vector3i chunkPosition()
        Gets the position of the chunk.

        The returned position is 3-dimensional with the Y-coordinate set to be the base (lowest) Y-position of the chunk. As 3-dimensional chunks do not yet exist in Minecraft, the returned position will always have a y set to 0.

        The position
      • inhabitedTime

        Ticks inhabitedTime()
        Gets the number of ticks players have been present in this chunk, used for calculation of the regional difficulty factor. In vanilla, it is increased by the number of players in the chunk every tick, and is capped at 3,600,000 ticks (50 hours).
        The number of ticks
      • setInhabitedTime

        void setInhabitedTime​(Ticks newInhabitedTime)
        Sets the number of ticks players have been present in this chunk.
        newInhabitedTime - The Ticks to set this value to
        See Also: