YAML (YAML Ain't Markup Language) is the file format used by most Bukkit/Spigot/Paper plugins for configuration files, using indentation-based structure. Instead of complex XML tags or JSON brackets, YAML uses simple key-value pairs and indentation to create readable, hierarchical configuration files that server admins can easily understand and edit. Almost every plugin you install will have a config.yml file using this format.
YAML is a human-readable data serialization format which is a way to store structured data in plain text files. It's designed to be easy for humans to read and write while still being machine-parseable.
A typical YAML configuration looks like this:
textserver-name: "My Minecraft Server"
max-players: 20
enable-pvp: true
spawn-location:
world: world
x: 0
y: 64
z: 0
YAML files use the .yml or .yaml file extension and are edited with any text editor.
YAML uses spaces (not tabs) for indentation to show hierarchy. Indented lines are nested inside lines one level higher:
textpermissions:
admin:
- command.reload
- command.op
moderator:
- command.kick
- command.mute
Critical rules:
This is the most common source of YAML errors: incorrect indentation.
The basic YAML structure is key: value:
textserver-port: 25565
motd: "Welcome to my server!"
online-mode: true
Lists use hyphens followed by a space:
textworlds:
- world
- world_nether
- world_the_end
Or inline format:
textworlds: [world, world_nether, world_the_end]
Simple strings don't need quotes:
textmessage: Hello player
Use quotes for strings with special characters or to preserve spacing:
textmessage: "Hello: Player!"
colored-message: "&cRed Text"
Lines starting with # are comments and ignored by parsers:
# This is a comment
max-players: 20 # You can also comment at the end of lines
# WRONG - uses tabs
settings:
max-players: 20 # Will cause parse errors
# CORRECT - uses spaces
settings:
max-players: 20
Fix: Configure your text editor to insert spaces when you press Tab.
# WRONG - mixing 2 and 4 space indentation
permissions:
admin:
- command.op # 4 spaces
moderator:
- command.kick # 2 spaces
# CORRECT - consistent 2-space indentation
permissions:
admin:
- command.op
moderator:
- command.kick
# WRONG
max-players:20
# CORRECT
max-players: 20
# WRONG - colon confuses parser
message: Hello: World
# CORRECT
message: "Hello: World"
Bukkit originally chose YAML for plugin configurations because:
However, YAML has drawbacks. Meaningful whitespace and indentation rules confuse beginners, causing 10+ daily support requests in plugin communities.
Before restarting your server with edited configs, validate your YAML syntax to catch errors:
while parsing a block mapping = indentation errorexpected <block end>, but found = missing or extra indentationcould not find expected ':' = missing space after colon or syntax errorMost plugins use Bukkit's built-in YAML parser through the FileConfiguration API:
java// Loading a YAML file
FileConfiguration config = YamlConfiguration.loadConfiguration(file);
// Reading values
int maxPlayers = config.getInt("max-players");
String message = config.getString("welcome-message");
// Saving changes
config.set("max-players", 30);
config.save(file);
The plugin.yml file is a special YAML file required by all plugins that defines metadata like name, version, author, and commands.
.editorconfig to automatically use spacesYAML is the standard configuration format for Minecraft plugins because of its readability and simplicity. While its indentation-based syntax can trip up beginners, understanding the basic rules; use spaces not tabs, maintain consistent indentation, and add spaces after colons. This makes YAML configs easy to edit.
CYBER DEAL
UP TO -40%
Host a Minecraft Server today with the best Cyber deal discount