Commands
Setting the Spawn Point
Use/setspawn to set the server spawn location to your current position.
hubbly.command.setspawn
When you use
/setspawn, the yaw and pitch angles are automatically rounded to the nearest standard angle (-135, -90, -45, 0, 45, 90, 135) for a cleaner spawn experience.Teleporting to Spawn
Players can teleport to the spawn point using the/spawn command.
hubbly.command.spawn
Configuration
Configure spawn settings inconfig.yml:
config.yml
Configuration Options
world
world
The world name where the spawn point is located.Type: String
Default:
Default:
"world"x, y, z
x, y, z
The coordinates of the spawn point.Type: Number
Default:
Default:
0, 200, 0yaw & pitch
yaw & pitch
The viewing direction when players spawn.Type: Number
Note: Values are automatically rounded when using
Note: Values are automatically rounded when using
/setspawntimer
timer
Delay in seconds before teleporting the player to spawn.Type: Integer
Default:
Default:
2sound
sound
Sound effect to play when a player teleports to spawn.Type: Sound (Bukkit Sound enum)
Default:
Default:
entity.firework_rocket.blastAnti-Void Protection
Hubbly includes automatic anti-void protection that teleports players back to spawn when they fall below the void threshold.config.yml
Implementation Details
The spawn system is implemented through several components:- SpawnCommand.java: Handles the
/spawncommand and initiates the teleport task - SetSpawnCommand.java: Handles the
/setspawncommand with automatic angle rounding - SpawnTeleportTask: Manages the delayed teleportation with timer countdown
- HubblySpawnEvent: Allows other plugins to interact with spawn teleportation
Code Example
Here’s how the spawn location is retrieved from the configuration:Best Practices
Choose a safe location
Set your spawn point in a safe, open area where players won’t spawn inside blocks or fall immediately.
Test the timer
Adjust the
timer value based on your server’s needs. A 2-second delay is usually sufficient to prevent spam.Enable anti-void
Turn on anti-void protection to prevent players from falling into the void and dying.
Related Features
- Disabled Worlds - Prevent spawn teleportation in specific worlds
- Main Configuration - Configure join/leave messages and actions on join