Interface WorldBorder.Builder

    • Method Detail

      • overworldDefaults

        WorldBorder.Builder overworldDefaults()
        Sets all values in this builder to the default border for a standard Minecraft overworld.

        This is not the same as calling Builder.reset(), which unsets all values, requiring at a targetDiameter(double) to be set befor this can be built.

        Returns:
        This builder, for chaining.
      • center

        WorldBorder.Builder center​(double x,
                                   double z)
        Sets the center of this world border.
        Parameters:
        x - The x-coordinate of the new centre
        z - The z-coordinate of the new centre
        Returns:
        The builder, for chaining
      • initialDiameter

        WorldBorder.Builder initialDiameter​(double size)
        Sets the initial diameter of this world border.

        If this differs from the the value supplied to targetDiameter(double), then the border size starts at the diameter specified here, growing or shrinking at a constant speed for the time provided in timeToTargetDiameter(Duration) where it will stop at the supplied target. If the supplied time is zero or not given, then this value is ignored and the target diameter is used.

        If this is set but targetDiameter(double) has not, then this also sets that target diameter.

        Parameters:
        size - The diameter that this border will have when this WorldBorder is set.
        Returns:
        The builder, for chaining.
      • safeZone

        WorldBorder.Builder safeZone​(double safeZone)
        Sets the distance beyond this world border that an entity may travel before incurring damage.
        Parameters:
        safeZone - The distance in blocks
        Returns:
        The builder, for chaining.
      • damagePerBlock

        WorldBorder.Builder damagePerBlock​(double damagePerBlock)
        Sets the damage caused by being out of the world border.
        Parameters:
        damagePerBlock - The damage amount
        Returns:
        The builder, for chaining
      • warningTime

        WorldBorder.Builder warningTime​(Duration warningTime)
        Sets the warning time of this world border.
        Parameters:
        warningTime - The warning time
        Returns:
        The builder, for chaining
      • warningDistance

        WorldBorder.Builder warningDistance​(double warningDistance)
        Sets the warning distance of this world border.
        Parameters:
        warningDistance - The warning distance
        Returns:
        The builder, for chaining