We have a video tutorial on how to set up a world border:
A world border is a boundary or limit that surrounds an area of a Minecraft world that prevents players and other entities from moving beyond the border. Setting a world border is especially useful to limit the chunks being generated when players travel your world which sometimes causes lag or makes your world file's size get excessively large.
Players will take damage when outside of the border. While redstone builds and water or lava flow are unaffected, placing of blocks and liquids outside of the border may be limited if at all possible.
The world border feature is available to Minecraft Java Edition only. For Bedrock Edition servers (NukkitX or PocketMine-MP), you will need plugins to configure your world border.
Setting Up A World Border
- Specify the center of your world border by using the command
/worldborder center <X> <Z>, replacing <X> and <Z> with your X and Z coordinates. It is recommended to set this on your world spawn.
If this successful, you should receive a message similar to the one shown below.
- Once the center is set, you can now specify the size of the world border using the command
/worldborder set <size>. For example, doing /worldborder set 20 will change the diameter or distance from one end of the border to the opposite end to 20 blocks.
Your world's border should now be set and will keep players from venturing beyond.
Other World Border Configuration Commands
Displays the current size of the world border.
/worldborder set <size> <time>
Adjusts (increase or decrease) the world border to the given size within the provided time, in seconds. For example /worldborder set 20 5 will resize the current border size to 20 within 5 seconds.
/worldborder damage amount <DamageAmount>
Sets the amount of damage (<DamageAmount>) a player receives every second they're outside the world border. For example /worldborder damage amount 1
/worldborder damage buffer <distance>
Sets <distance> as the number of blocks from the world border that a player starts to take damage. For example /worldborder damage buffer 5 will cause players to take damage when they're more than 5 blocks outside of the border.
/worldborder warning distance <distance>
Sets <distance> as the number of blocks from the world border when a player sees a warning of the border's proximity. For example /worldborder warning distance 2
/worldborder warning time <time>
Sets <time> as the number of seconds when the player begins to see a warning of the border's proximity as it gets closer. For example /worldborder warning time 2