Skip to content

Repository files navigation

Spawnpoint

Spawnpoint controls where players land when they first join or teleport home on Eternal Empires — a single configured location shared across the whole server, rather than each world's built-in vanilla spawn.

What it does

A SpawnPoint is just a world name plus x/y/z/yaw/pitch, configured once. On join, PlayerJoinListener teleports new/returning players there. Players can also return to it manually with /spawn, which dismounts any vehicle, teleports asynchronously, and reports a translated success or error message — including handling the case where the configured spawn world isn't currently loaded.

Commands

Command Description
/spawn Teleport to the server's configured spawn point

The API

SpawnPointProvider.provideSpawnPoint() is the entire surface area — resolve the currently configured SpawnPoint and read its world and coordinates. Useful for anything that needs to send a player "home" without hardcoding a location.

Modules

  • api — the public SpawnPoint/SpawnPointProvider interfaces. No implementation, published for other plugins to depend on.
  • common — the config-backed implementation.
  • paper — the Paper plugin: the join listener and /spawn command.

Requirements

Java 21, Paper 1.21 or newer, and multilanguage for command messages.

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, config.yml is generated under plugins/spawnpoint/:

spawn:
  world: 'world'
  x: 0.0
  y: 64.0
  z: 0.0
  yaw: 0.0
  pitch: 0.0

Using the API from another plugin

If your plugin needs to send a player back to the server's spawn point, depend on spawnpoint-api instead of hardcoding a location:

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

dependencies {
    compileOnly 'net.eternalempires:spawnpoint-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 - spawn point management

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages