Runs a command, optionally as console or permission elevated when receiving advancements
- Tested Minecraft Versions:
- 1.12
- Source Code:
- https://github.com/aikar/AdvancementCommand
- Donation Link:
- https://paypal.me/empireminecraft
Documentation
See examples below for format
Each entry must define:
An advancement can be defined multiple times in the list to perform multiple commands.
- advancement
- command OR commands OR alias
If no other configuration is provided, it will be ran as the player without op or any elevated permissions.
Alias will alias one advancement to run the same commands as another, so you don't have to duplicate it.
Keys
Variables
- advancement: the advancement key such as minecraft:husbandry/root to trigger on
- command: what command to run, see variables below for template variables
- commands: Alternatively, a list of what command to run, see variables below for template variables
- run_as: player or console - who receives the command feedback
- op: Should player be given temporary op for this command. Unnecessary for run_as: console
- permission: Permission node to give temporarily for this command. Example:
permission: minecraft.command.teleport- permissions: Same as above, but a list of permission nodes. Example:
permissions:
- minecraft.command.teleport
- some.other.perm- alias: Alias this advancement to run the same command information as another advancement defined here. You may still define permissions, run_as and op on the aliased entry, which will be added onto the permissions granted by the alias target.
In other words, you can alias foo to bar, where bar is defined to have permission b, and foo (the alias) is defined to have permission a, the command defined in bar will have both a and b permissions.
Inside of a command, you may use the following variables
Examples
- %PLAYER: The name of the player earning the advancement.
- %UUID: The UUID of the player earning the advancement.
- %PLAYERDISPLAYNAME: The display name of the player earning the advancement. (might be the same as player)
- %ADVANCEMENT: The advancement key (eg minecraft:adventure/root) being earned.
Code (Text):
on_advancement:
# example of running command temporarily as op - be careful, any sub commands of this command will have op too!
- advancement: minecraft:example
run_as: player
command: ranks add %player rank1
op: true
# run a standard command with no permissions
- advancement: minecraft:example
run_as: player
commands:
- say Hey I just got an advancement!
- me Dances!
op: false
# run a command as the console (command feedback to console instead of the player, ideal for rank changes)
- advancement: myplugin:gainrank1
run_as: console
command: ranks add %player rank1
op: false
# run a command temporarily given a specific permission node, but not op
- advancement: myplugin:teleport_to_secret
run_as: player
command: teleport %player some secret coords
permission: minecraft.command.teleport
- advancement: minecraft:husbandry/tame_an_animal
alias: myplugin:teleport_to_secret
- advancement: minecraft:husbandry/plant_seed
alias: myplugin:teleport_to_secret

Advancement Command 1.1.0
Run commands, potentially with elevated permissions, once a player has earned an advancement.