SpawnRand icon

SpawnRand -----

A lightweight Bukkit / Spigot / Paper mod for randomizing initial spawn location.



Technical Details

Program behavior is governed by the config.yml as with most mods. Player specific data such as the player's spawn point is stored in playerData.yml right next to it. The player's UUID is used, but the players name is also recorded to make it easier to edit if needed.
  • centerX and centerZ define the center of random spawn point selection.
  • minDistance and maxDistance define the range of distance from center that will be accepted.
  • "Distance" means actual radial distance. Not square block area.
The algorithm used to select random spawn point involves choosing a random spawn point in a square with sides of 2 * maxDistance. Then, the actual distance from center is calculated and anything not meeting the config specs is rejected. And any spawn point that we can detect as dangerous (i.e. over lava) is rejected.

This is the most efficient algorithm for selecting a random point within a circle (see: https://bit.ly/32UH1Bh), but it can be problematic for some configurations. To prevent potential issues, min and max distance config rules are:
  1. maxDistance must be 100 or greater.
  2. minDistance must be less than 80% of maxdistance.
  3. Additionally, all possible results must be within the server's world border.
Config settings not meeting those requirements will be automatically adjusted to meet them if possible.

The minimum distance from the center defaults to 250, to enforce some distance from (0,0). This keeps a central area free of initial houses, and creating a logical place for group builds after players start exploring. The max distance defaults to 1250, which is close enough for experienced players to easily make their way to the middle if they want.

For very young or beginning players, you might want this range smaller so players can find each other easier. For a highly populated server, you may need a considerably larger radius to give everyone enough space.
Resource Information
Author:
----------
Total Downloads: 115
First Release: Jan 3, 2022
Last Update: Jan 3, 2022
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings