Skip to content

SpawningContext

Package: com.hypixel.hytale.server.spawning

public class SpawningContext

Central position validation mechanism shared by all spawn modes (world spawning, beacons, and spawn markers). Resolves a spawn position within a chunk column by analyzing spawn spans (contiguous empty blocks), checking ground level, water level, air height, block materials, and model bounding box fit.

FieldTypeDescription
worldWorldTarget world
worldChunkWorldChunkTarget chunk
xBlock / zBlockintBlock position within chunk
groundLevelintY level of the ground block
groundBlockTypeBlockTypeBlock type at ground level
waterLevelintY level of water surface (-1 if no water)
airHeightintY level of first air block above ground/water
xSpawn / ySpawn / zSpawndoubleFinal computed spawn position
MethodReturn TypeDescription
setSpawnable(ISpawnableWithModel)booleanResolves the model and bounding box for spawn fit checks
setSpawnable(ISpawnableWithModel, boolean)booleanResolves model with optional max-scale mode
setChunk(WorldChunk, int)voidSets the target chunk and environment index
setColumn(int, int, int, int[])booleanScans a column for valid spawn spans within Y range
setColumn(int, int, int, int[], SuppressionSpanHelper)booleanScans a column with suppression zone exclusions
set(World, double, double, double)booleanSets a specific world position and resolves the nearest spawn span
canSpawn(boolean, boolean)SpawnTestResultMaster validation checking block and entity overlap
canSpawn()SpawnTestResultValidates both block and entity overlap
isOnSolidGround()booleanChecks for solid block beneath spawn position
isInWater(float)booleanChecks for sufficient water depth
isInAir(double)booleanChecks for air spawn at given height
canBreathe(boolean, boolean)booleanBreathing validation for air/water respiration
validatePosition(int)booleanCollision module position check against invalid materials
selectRandomSpawnSpan()booleanSelects a random valid spawn span from the current set
newPosition()Vector3dCreates a new position vector from computed spawn coordinates
newRotation()Vector3fCreates a new rotation vector with random yaw
  • SpawnSpan — private data holder for a contiguous span of empty blocks with bottom, top, water level, and ground level.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.