Skip to main content

Spawns

The spawns module is required in a complete map XML because it specifies where players and observers can spawn. Default and observer spawns are defined with the <default> element and all other spawns in <spawn> elements. Only one default spawn element may be defined per map.

Multiple spawns from the same team can be grouped inside of a single <regions> element inside <spawns team="team-id">. Spawn positions are picked randomly inside of the defined regions. Since PGM will not validate the spawn position by default, regions should be checked to make sure that they don't intersect with solid objects or are mid-air. Spawns can also be defined with the safe="true" attribute, PGM will then check that the player spawns on a solid object and not midair.

The regions element accepts more than one region or region area. If they are not inside a <union> element one region will be picked at random for each spawn event.

Respawn behavior such as delays, etc. can be customized with the respawn module.

ElementDescription
<spawns> </spawns>Node containing the spawns for this map.
Sub-elementsValue/Children
<spawn>An individual spawn where a team will spawn.<regions>
<default>UniqueThe spawn for observers and teams without a spawn.
Only one default spawn element is allowed per map.
<regions>

Spawn & Default Element Attributes

AttributeDescriptionValueDefault
teamThe team this spawn applies to.
Not needed for team-less gamemodes.
Team ID
safeValidate that the player spawns in a safe location.true/falsefalse
sequentialSpawns players at the next region in a list if the one prior to it is not safe.
Requires the safe attribute set to true.
true/falsefalse
spreadSpawn players as far away as possible from enemy players.true/falsefalse
spread-teammatesSpawn teammates as far away as possible from each other.true/falsefalse
exclusiveSpawn regions are assigned exclusively to one player or team and only they will spawn there.true/falsefalse
persistentOnce a player has been assigned a spawn, they will spawn there even if they leave and rejoin the game.true/falsefalse
kitPropertyThe kit to apply to players when they are spawned in this spawn.Kit ID
filterPropertyFilter when this spawn is used.Filter

Spawn & Default Element Sub-elements

ElementDescriptionValue/Children
<regions>The region or regions where players will spawn.Regions

Regions Element Attributes

tip

Copy the yaw and pitch from the Debug screen (F3) in Minecraft (the Facing: Direction (Axis) (Yaw/Pitch) line).

AttributeDescriptionValueDefault
angleThe exact block coordinates that the player looks at when spawned.
This attribute will negate any angles set by the yaw and pitch attributes.
X,Y,Z
yawThe horizontal angle the player looks to when spawned.
South 0°, East -90°, North 180°, and West 90°.
-180 to 1800
pitchThe vertical angle the player looks to when spawned.
-90° is straight up, 90° is straight down.
-90 to 900

Examples

<spawns>
<spawn team="red" kit="red">
<regions yaw="90">
<cuboid min="-2,13,71" max="-9,13,78"/>
</regions>
</spawn>
<spawn team="blue" kit="blue">
<regions yaw="-90">
<cuboid min="2,13,-71" max="9,13,-78"/>
</regions>
</spawn>
<default>
<regions>
<cuboid min="-1,16,-1" max="2,20,2"/>
</regions>
</default>
</spawns>
<!-- Example spawns from Assualt -->
<spawns>
<spawn team="blue" kit="blue" region="blue-spawn" yaw="-90"/>
<spawn team="red" kit="red" region="red-spawn" yaw="90"/>
<default kit="obs" region="obs-spawn" yaw="-135"/>
</spawns>

<spawns safe="true" sequential="true">
<spawn team="blue" kit="blue" yaw="180">
<regions>
<cuboid min="-10,71,5" max="12,126,27"/> <!-- Players will spawn here first -->
<cuboid min="-10,6,5" max="12,6,27"/> <!-- Secondary spawn if the first isn't available -->
<point>1.5,8,0.5</point> <!-- Tertiary spawn if all other team spawns aren't safe -->
</regions>
</spawn>
<spawn team="red" kit="red">
<regions>
<cuboid min="-10,71,-27" max="12,126,-5"/>
<cuboid min="-10,6,-27" max="12,6,-5"/>
<point>1.5,8,0.5</point>
</regions>
</spawn>
</spawns>

Respawn Module

The respawn module allows the map creator to adjust the respawn time and if players are automatically respawned. For maps that may require instant respawn, you can set the delay to 0s and auto to true.

To allow players to spawn at a bed set the bed attribute to true. Players spawning at beds will not spawn with a kit, even if there is one specified. If a player has a bed spawn location set, it overrides all other spawn regions for that player.

ElementDescription
<respawn/>Node specifying the default respawn settings for this map.
<respawns>Node specifying multiple respawn options for this map.
Respawn Attributes
AttributeDescriptionValueDefault
delayDelay a player's respawn for this duration.Time Period2s
filterFilters when the respawn is used.Filter
autoAutomatically respawn the player after the delay time has elapsed.true/falsefalse
blackoutDead players get a blindness effect applied.true/falsefalse
spectateAllow dead players to fly around.true/falsefalse
bedN/AAllow players to respawn from beds.true/falsefalse
messagePropertyMessage to display on the respawn screen to respawning players.Formatted Text
Respawn Sub-elements
ElementDescriptionValue/Children
<message>PropertyMessage to display on the respawn screen to respawning players.Formatted Text
<!-- Default auto respawn of 2 seconds -->
<respawn auto="true"/>

<!-- Allow players to respawn after 3 seconds, blackout the player when they die -->
<respawn delay="3s" blackout="true"/>

<!-- Allow respawning after 5s, display translatable waiting on flag drop respawn message -->
<respawn delay="5s" spectate="true">
<message>{translate: "death.respawn.confirmed.waiting.flagDropped"}</message>
</respawn>

<!-- Allow respawning after 1.5 seconds -->
<!-- After 10 minutes has passed, allow respawning after 10 seconds -->
<respawns>
<respawn delay="10s" filter="after-10m"/>
</respawns>
<respawn delay="1.5s"/>