Interface WorldBorder


  • public interface WorldBorder
    A world border is a square boundary, extending through the entire y-axis.

    It can gradually grow or shrink to a radius over a period of time. A warning is displayed when a contracting world border will reach the player in a certain amount of time, or when the player is a certain number of blocks away.

    In Minecraft, a warning is displayed in the form of a reddish tint.

    • Method Detail

      • defaultBorder

        static WorldBorder defaultBorder()
        Gets a WorldBorder that represents the default border values for a newly created overworld.
        Returns:
        A WorldBorder that represents the default values
      • center

        Vector2d center()
        Gets the center of the world border.

        The x coordinated can be retrieved through Vector2d.x(), while the z coordinated can be retrieved through Vector2d.y().

        Returns:
        The center
      • diameter

        double diameter()
        Gets the current diameter of this world border. If this is an immutable border, this is the initial diameter.

        The returned diameter applies to the x and z axis. The world border extends over the entire y-axis.

        Returns:
        The size
      • targetDiameter

        double targetDiameter()
        Gets the target diameter the world border is expanding or contracting to.

        This will return the same value as diameter() unless timeUntilTargetDiameter() is greater than 0.

        Returns:
        The diameter being changed to
      • safeZone

        double safeZone()
        Gets the distance a player may be outside the world border before taking damage.
        Returns:
        The distance
      • damagePerBlock

        double damagePerBlock()
        Gets the damage done to a player per block per tick when outside the buffer.
        Returns:
        The damage amount
      • warningTime

        Duration warningTime()
        Gets the time when a contracting world border will warn a player for whom the world border will reach in time seconds.

        In Minecraft, the warning is displayed in the form of a reddish tint.

        Returns:
        The warning time
      • warningDistance

        int warningDistance()
        Gets the distance when a contracting world border will warn a player for whom the world border is distance away.

        In Minecraft, the warning is displayed in the form of a reddish tint.

        Returns:
        The distance