public interface WorldBorder
Modifier and Type | Method and Description |
---|---|
Location |
getCenter()
Gets the current border center.
|
double |
getDamageAmount()
Gets the current border damage amount.
|
double |
getDamageBuffer()
Gets the current border damage buffer.
|
double |
getSize()
Gets the current side length of the border.
|
int |
getWarningDistance()
Gets the current border warning distance.
|
int |
getWarningTime()
Gets the current border warning time in seconds.
|
void |
reset()
Resets the border to default values.
|
void |
setCenter(double x,
double z)
Sets the new border center.
|
void |
setCenter(Location location)
Sets the new border center.
|
void |
setDamageAmount(double damage)
Sets the amount of damage a player takes when outside the border plus the border buffer.
|
void |
setDamageBuffer(double blocks)
Sets the amount of blocks a player may safely be outside the border before taking damage.
|
void |
setSize(double newSize)
Sets the border to a square region with the specified side length in blocks.
|
void |
setSize(double newSize,
long seconds)
Sets the border to a square region with the specified side length in blocks.
|
void |
setWarningDistance(int distance)
Sets the warning distance that causes the screen to be tinted red when the player is within the specified number of blocks from the border.
|
void |
setWarningTime(int seconds)
Sets the warning time that causes the screen to be tinted red when a contracting border will reach the player within the specified time.
|
void reset()
double getSize()
void setSize(double newSize)
newSize
- The new size of the border.void setSize(double newSize, long seconds)
newSize
- The new side length of the border.seconds
- The time in seconds in which the border grows or shrinks from the previous size to that being set.Location getCenter()
void setCenter(double x, double z)
x
- The new center x-coordinate.z
- The new center z-coordinate.void setCenter(Location location)
location
- The new location of the border center. (Only x/z used)double getDamageBuffer()
void setDamageBuffer(double blocks)
blocks
- The amount of blocks. (The default is 5 blocks.)double getDamageAmount()
void setDamageAmount(double damage)
damage
- The amount of damage. (The default is 0.2 damage per second per block.)int getWarningTime()
void setWarningTime(int seconds)
seconds
- The amount of time in seconds. (The default is 15 seconds.)int getWarningDistance()
void setWarningDistance(int distance)
distance
- The distance in blocks. (The default is 5 blocks.)Copyright © 2022. All rights reserved.