Skip to main content

XML Conventions

Indentation

Map Indentation

Modules must all start on column one. This means that all children tags under the <map> tag must be aligned with said <map> tag.

<map proto="1.5.0">
<name>Blocks DTC</name>
<version>1.3.4</version>
<objective>Leak lava from the enemy's obsidian core.</objective>
</map>

Child Element Indentation

Modules that have sub elements such as the author tag must be indented with 4 spaces below the parent element.

<map proto="1.5.0">
...
<authors>
<author uuid="060baa18-2852-40d8-afcb-e61607c04be3"/> <!-- PepsiDog -->
</authors>
</map>

Space Between Modules

There should be no white spaces between modules. That means the end of one module should have the start of another on the immediate next line.

<!-- Correct -->
<map proto="1.5.0">
<name>Blocks DTC</name>
<version>1.3.4</version>
<objective>Leak lava from the enemy's obsidian core.</objective>
</map>
<!-- Incorrect! -->
<map proto="1.5.0">

<name>Blocks DTC</name>

<version>1.3.4</version>

<objective>Leak lava from the enemy's obsidian core.</objective>

</map>

XML declaration

Not to be confused with the protocol or map version, it is the first line that may be present in older XML files. It is no longer neccessary to add unless you are using certain characters that will not work under UTF-8 encoding.

<!-- Default XML declaration -->
<?xml version="1.0" encoding="utf-8"?>

Closing tags

The ending tag of one module should be on the line directly above the beginning tag of a following module.

Line Ending

XML files must end with an empty line. For example, if the ending </map> tag is on line 52, the last line of the XML file would be line 53. Most modern text editors will usually handle this for you.

Layout

Main Map Definitions

There are 6 modules that make up the maps definition. They should all be placed at the top of the document; following the order below: map, name, version, objective, authors and contributors.

note

Contributors are optional but are still to remain near the top of a XML file.

<map proto="1.5.0">
<name>Blocks DTC</name>
<version>1.3.4</version>
<objective>Leak lava from the enemy's obsidian core.</objective>
<authors>
<author uuid="060baa18-2852-40d8-afcb-e61607c04be3"/> <!-- PepsiDog -->
</authors>
<contributors>
<contributor contribution="A contribution">aHelper</contributor>
</contributors>
</map>

The Protocol

All maps should use the latest protocol version. The proto version can be defined with this line:

<map proto="1.5.0">

Authors and Contributors

An author using a UUID definition should have an inline comment to denote the player's in-game name.

<authors>
<author uuid="260004f0-996b-4539-ba21-df4ee6336b63"/> <!-- Elliott_ -->
</authors>

Filters and Regions

The filter definition should be defined before the definition of regions.

Naming Conventions

Versioning

Follow the Semantic Versioning for your map's version. For example: 1.2.3

A Major is classified by the addition of major gameplay changes - changes that could be called a new map. A Minor is classified by the addition of changes that affect gameplay but not to the extent of a major. A Patch is classified by a small change to fix a bug or unintentional feature.

<!-- Major.Minor.Patch -->
<version>1.2.3</version>
note

Bump the patch number when you fix something on a map.

Objectives

Objectives are short and concise statements that tell the player what they need to do to win the match.

<objective>Win the match by killing the enemy team!</objective>

Identification Naming

Modules that require an id to be defined should be named in all lowercase and use a dash (-) to signify a space.

One exception to this is that variable ids cannot use a dash (-) and instead must use underscores (_) to signify a space.

<team id="only-blue">blue-team</team>

<!-- Variables -->
<variable id="cant-do-this"/>
<variable id="do_this_instead"/>

Team Filters

Team filters should be named by following the identification naming and start with only- followed by the team name.

only-blue only-elves

Enumeration Naming

Bukkit names should be set into lower case with underscores (_) replaced with spaces. For example, PROTECTION_ENVIRONMENTAL should be protection environmental.