Main Map Element
Every map XML file must contain the base <map>
module.
It contains modules that specify the map name, version, objective, authors, contributors, and all other map settings.
The objective is the text that players see when they join the match, and so it is important for this to be very clear, concise, and informative.
The proto=""
attribute specifies what PGM version the XML file was created for.
Mapmakers should always use the latest supported proto version, which is documented in depth at Protocol Versions.
The maps version should follow the versioning schema major.minor.patch
.
Map Element | Description | Value/Children |
---|---|---|
<map> </map> | The main map node containing all the modules used in this match. | XML Modules |
Map Attributes
Map Attributes | Description | Value | Default |
---|---|---|---|
proto | RequiredThe map's XML protocol version. | 1.4.2 | |
internal | Prevent compass teleports above Y=255. | true/false | false |
Map Sub-elements
Element | Description | Value/Children | Default |
---|---|---|---|
<name> | RequiredThe name of the map. | String | |
<slug> | The map's internal identifier, usually auto generated from the map's name. This should only be used when a map is renamed to retain the map's ratings, etc. Valid slugs are lowercase and only contain the characters: a-z 0-9 _ | String | Auto Generated |
<version> | RequiredThe map's semantic version. | 1.0.0 | |
<objective> | RequiredThe map's objective, shown at the start of the match. | String | |
<authors> | RequiredThe authors of the map. At least one author is required. | <author> | |
<contributors> | Contributors to the map. | <contributor> | |
<created> | The date on which this map was initially released. | YYYY-MM-DD | |
<phase> | The stage of development the map is in. Note: By default, it will not appear in the list when a user runs /maps . In legacy PGM, only maps in production phase show up on a website configured with an API. | development staging production | production |
<edition> | The type of gameplay environment this map is intended for. Note: In legacy PGM, only standard edition maps show up on a website configured with an API. | standard ranked tournament | standard |
<game> | A custom title for this match's gamemode. Note: A map can have multiple gamemode titles. PGM will select the last as the map's primary title. | String | |
<gamemode> | The gamemode(s) of this map. If this is not specified the map will set the gamemode(s) to whatever modules are used. | Gamemode ID |
<map proto="1.5.0">
<name>Map Name</name>
<version>1.0.0</version>
<objective>Short description about the map's objective.</objective>
<!-- Map authors & contributors. -->
<!-- Map modules, i.e. objectives, regions, spawns. -->
</map>
Authors & Contributors
The authors and contributers elements provide information about who created and helped create the map. There can be multiple authors and contributors to a map. The contribution attribute should be used to specify what their contribution to the map was.
A player's name should not be used to credit them, instead their UUID should be used. A UUID is a universally unique identifier that is used to keep track of players even if they change their name. You can check player UUIDs at mcuuid.net. If an author or contributor is defined without a UUID, that player will not get any mapmaker perks on the map.
Author or Contributor Sub-elements
Element | Description | Value/Children |
---|---|---|
<author> | A major author of the map, used in <authors> . | String |
<contributor> | A contributor to the map, used in <contributors> . | String |
Author & Contributor Attributes
Attribute | Description | Value |
---|---|---|
uuid | The UUID used to identify a Minecraft player. | String |
contribution | A description of the contribution this author or contributor made to the map. | String |
<!-- Major map authors -->
<authors>
<author>aPerson</author> <!-- Credit a person that doesn't have a Minecraft account -->
<author uuid="ef4ea031-998f-4ec9-b7b6-1bdd428bcef8" contribution="Clarification of element usage, etc."/> <!-- Plastix -->
<author uuid="260004f0-996b-4539-ba21-df4ee6336b63"/> <!-- Elliott_ -->
</authors>
<!-- People that contributed in some way to the map -->
<contributors>
<!-- Credit a person that doesn't have a Minecraft account -->
<contributor contribution="A contribution">aHelper</contributor>
<contributor uuid="3fbec7dd-0a5f-40bf-9d11-885a54507112" contribution="Some help"/> <!-- Cubist -->
</contributors>
Include Statements
Include statements allow for global XML files to be loaded and re-used across different maps. This can be used to standardize values across maps. Below is a sample includes file that can be used on Blitz maps:
<!-- the location for include files is defined in config.yml -->
<map>
<blitz>
<lives>5</lives>
</blitz>
</map>
The file is automatically given an ID based on the file name, which in this case is blitz
.
Then it can be added into the main map.xml
. Multiple include statements can be used per map.
<map>
...
<!-- All maps with this include statement will give the player 5 lives -->
<include id="blitz"/>
...
</map>
Map Variants
Mapmakers may choose to build different versions of their maps that are tailored for events, such as tournaments. This tool allows them to avoid the need to duplicate existing maps and, instead, unify various versions into one location.
By defining a variant ID, PGM will treat an individual map with one or more variants as separate maps.
Each variant can contain conditionals, which determine whether a section of the XML file from the base (internally, the default
variant) map should be loaded for a variant map.
Additionally, a variant can also contain constants, which allows you to define text constants that can be used to replace placeholders in the base map XML with the specified values.
Variant Sub-elements
Element | Description | Value/Children |
---|---|---|
<variant> </variant> | A map variant. | String |
Variant Attributes
Attribute | Description | Value | Default |
---|---|---|---|
id | RequiredUnique identifier used to reference this map variant from other places in the XML. | String | |
world | The world the variant should use during a match. | String | |
override | Toggle if the variant name should override the base map name. If set to false, PGM will append : [variant] to the base map name. | true/false | false |
Conditionals Sub-elements
Element | Description | Value/Children |
---|---|---|
<if> </if> | Apply an XML section if the specified variant is loaded. | XML Modules |
<unless> </unless> | Apply an XML section for all variants except for a specific variant when loaded. | XML Modules |
If/Unless Conditional Attributes
Attribute | Description | Value |
---|---|---|
variant | The name of the variant to target. | Variant ID |
has-variant | Target all maps with a specified variant. Note: This can be useful in a server's global XML file. | Variant ID |
Note: Multiple variants can be targeted as long as it is separated with a comma (,
).
Constants
Constants are values that remain the same, regardless of conditions.
PGM will search and replace any corresponding placeholders (${constant_id}
) with the constant value.
Element | Description | Children |
---|---|---|
<constants> </constants> | A node containing the constants for this map. | Constant Elements |
Sub-elements | ||
---|---|---|
<constant> </constant> | An individual constant. | String |
Constant Attributes
Attribute | Description | Value | Default |
---|---|---|---|
id | RequiredUnique identifier used to reference this constant from other places in the XML. | String | |
delete | When true, PGM will completely delete the attribute or element the constant was used in, rather than leaving it blank. | true/false | false |
The following example utilizes both map variants and constant.
<map proto="1.4.2">
<name>Map Name</name>
<variant id="5v5">5v5</variant> <!-- Loaded as "Map Name: 5v5" -->
<variant id="tournament">TE</variant> <!-- Loaded as "Map Name: TE" -->
<variant id="halloween" override="true">Spooky Map Name</variant> <!-- Loaded as "Spooky Map Name" -->
<!-- PGM will replace "${team_size}" and "${max}" placeholder with the new value -->
<constant id="team_size">25</constant>
<constant id="overfill" delete="true"/> <!-- "max-overfill" will not exist when "Map Name" is loaded -->
<constant id="max">6</constant>
<if variant="5v5">
<constant id="team_size">5</constant>
<constant id="overfill">5</constant>
<constant id="max">3</constant>
</if>
<if variant="tournament">
<constant id="team_size">6</constant>
<constant id="overfill">6</constant>
<constant id="max" delete="true"/>
</if>
<team id="red" max="${team_size}" max-overfill="${overfill}"/>
<team id="blue" max="${team_size}" max-overfill="${overfill}"/>
<score>
<limit>${max}</limit> <!-- 6 in "Map Name", 3 in "Map Name: 5v5", non-existent in "Map Name: TE" -->
</score>
</map>
Map Gamemode
The gamemode element is used to specify the gamemode(s) of the map.
This mainly affects how the map is displayed.
If no <gamemode>
tags are specified, the map will set the gamemode(s) to whatever modules are used.
This means that a map that uses destroyables and flags would be displayed as "DTM and CTF" unless specified otherwise.
Element | Description | Value/Children |
---|---|---|
<gamemode> </gamemode> | The gamemode(s) of this map. | Gamemode ID |
Gamemode IDs
ID | Description |
---|---|
arcade | Arcade |
ad | Attack/Defend |
bedwars | Bed Wars |
blitz | Blitz |
br | Blitz: Rage |
bridge | Bridge |
ctf | Capture the Flag |
ctw | Capture the Wool |
cp | Control the Point |
tdm | Deathmatch |
dtc | Destroy the Core |
dtm | Destroy the Monument |
5cp | 5 Control Points |
ffb | Flag Football |
ffa | Free for All |
infection | Infection |
kotf | King of the Flag |
koth | King of the Hill |
mixed | Mixed |
payload | Payload |
rfw | Race for Wool |
rage | Rage |
scorebox | Scorebox |
skywars | Skywars |
sg | Survival Games |
Example
<!-- A FFA map with scoreboxes -->
<gamemode>ffa</gamemode>
<gamemode>scorebox</gamemode>