Configuration
Add theCommands list under the Addon: section in your portal’s .yml file. Each list entry is a single string with three parts separated by semicolons.
Parts of Each Entry
executor — Who runs the command. Use player to run it as the player who used the portal, or console to run it as the server console (useful for commands that require operator privileges).
condition — A boolean expression that must evaluate to true for the command to fire. Use the placeholder variables listed below to build logic. Use true on its own to make a command always run. Supports && (AND), || (OR), and parentheses for grouping.
command — The command to execute, written without a leading /. Use placeholders anywhere in the command string.
Available Placeholders
| Placeholder | Description |
|---|---|
%portal% | The display name of the portal |
%name% | The internal name of the portal |
%entity% | The name of the player or entity type |
%entityID% | The UUID of the player or ID of the entity |
%destinationWorld% | The world the portal teleports to |
%destinationX% | Destination X coordinate |
%destinationY% | Destination Y coordinate |
%destinationZ% | Destination Z coordinate |
%originalWorld% | The world the player came from |
%originalX% | Original X coordinate |
%originalY% | Original Y coordinate |
%originalZ% | Original Z coordinate |
%zAxis% | true if the portal faces the X axis (built along the Z axis) |
Commands on Use also supports PlaceholderAPI placeholders. If PlaceholderAPI is installed, you can use any
%placeholder% string from your installed PAPI expansions inside the command field.Full Example
- The first entry fires every time any player uses the portal, broadcasting a server-wide message from the console.
- The second entry fires only when the destination is the
netherworld, giving the player a torch as the player themselves. - The third entry fires only when a complex condition is met — the destination is
world6and the user isplayer1, or alternatively the portal’s name ismyPortal.
Disabling Default Teleportation
If you want Commands on Use to handle teleportation entirely — for example, by running a random-teleport command instead of Dimensions’ built-in logic — addDisableTeleport: true to the Addon: block. This tells Dimensions to skip its own teleport step and leave movement entirely to your commands.
