Execute a command when a preset trigger (or event) occurs.
Concept
This was originally inspired by a plugin request on the BukkitDev forums, but has been expanded in scope to cover a more general purpose.
CommandTrigger's very first release will allow you to run a command from the console automatically when:
- A player joins the server
- A player leaves the server
Installation
- Copy the JAR file into your /plugins directory
- Start your Minecraft server
- Edit the configuration file
- Set enabled: true
- Modify the example triggers (see below)
- Run /commandtrigger reload from your console window
- Add permission nodes to users (see below)
You're good to go!
Configuration
This is the default config.yml contents at this point in time.
The triggers in this examples are named 'example', 'saveonjoin' and 'saveonquit'. You can name your triggers whatever you like. Following each trigger name is the command that will be executed when the criteria for it are met (a player with the correct permission node has joined or left the game).
# CommandTrigger configuration file# Request new features on BukkitDev# Triggers only occur when the player has the permission (e.g. 'CommandTrigger.triggers.playerjoin.example')settings:enabled:falsetriggers:playerjoin:-example- msg {name} Welcome to the server!-saveonjoin- save-allplayerquit:-saveonquit- save-all
The syntax for a trigger is as follows:
triggers:# DO NOT change this value.playerjoin:# Trigger type (playerjoin, playerquit)-example# Trigger name (anything you want)-msg {name} Welcome to the server!# Command to be executed
Permissions
Permission | Description | |||
CommandTrigger.admin | Gives access to run /commandtrigger reload | |||
CommandTrigger.triggers.playerjoin.triggername | Gives access to run a trigger with name triggername |
Note: If you have any operators, or users with the *.* permission node, manually negate any permissions that you do not want to apply to them.