Skip to content

Repository files navigation

World Border

World Border replaces vanilla Minecraft's /worldborder command with a config-driven, per-world border for Eternal Empires. Instead of setting borders in-game (and having them reset on world reload or forgotten after a restart), each world's border is defined once in a config file and enforced consistently every time the world loads.

What it does

On startup, the plugin unregisters vanilla's /worldborder command entirely — border configuration is meant to happen through worlds.yml, not in-game commands — and applies the configured border (center coordinates and size) to each world as it loads, via a WorldLoadListener. Other plugins can check whether a location falls inside or outside a world's border through the API rather than reimplementing the coordinate math.

The API

WorldBorderProvider resolves the WorldBorder for a given world. A WorldBorder exposes its center coordinates and size, plus isInsideBorder(x, z)/isOutsideBorder(x, z) checks — useful for anything that needs to validate a location before teleporting a player there or generating something at a given position.

Modules

  • api — the public WorldBorder/WorldBorderProvider interfaces. No implementation, published for other plugins to depend on.
  • common — the implementation backing the API.
  • paper — the Paper plugin: unregisters the vanilla command, loads worlds.yml, and applies borders as worlds load.

Requirements

Java 21 and Paper 1.20 or newer.

Building

./gradlew build

To get a plugin jar, build the paper module's shadow jar:

./gradlew paper:shadowJar

The resulting jar is written to paper/build/libs/.

Configuration

On first run, worlds.yml is generated under plugins/worldborder/, one entry per world:

world:
  size: 100
  center:
    x: 0
    z: 0

Add an entry for each world you want a border on; worlds without an entry are left unrestricted.

Using the API from another plugin

If your plugin needs to check whether a location is inside a world's border, depend on worldborder-api instead of duplicating the bounds check:

repositories {
    maven {
        url 'https://packages.eternalempires.net'
    }
}

dependencies {
    compileOnly 'net.eternalempires:worldborder-api:VERSION'
}

Replace VERSION with the release you want to target — see the Releases page for available versions.

License

See LICENSE.

Contributing

See CONTRIBUTING.md.

About

Eternal Empires - world border management

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages