◦•●❤♡ ᴄᴏɴᴛᴀᴄᴛ Dekomori on discord ꜰᴏʀ ꜱᴜᴘᴘᴏʀᴛ ♡❤●•◦
Tested Minecraft Versions: 1.8 / 1.9 / 1.10 / 1.11 / 1.12 / 1.13 / 1.14 / 1.15 / 1.16
ATTENTION: NO MORE FUNCTIONALITIES WILL BE ADDED TO THIS PLUGIN, THAT MEANS NO MORE UPDATES UNLESS IT IS SOMETHING RELATED TO BUGS/ERRORS.
What can I do with CommandConditions?
This plugin allows you to create specific requirements to execute different kind of commands. For example, you can create a condition for the command "/warp end" to teleport the player to The End. But the command will not execute, if the player doesn't have an enderpearl called "Ender Teleporter" with enchantment FIRE_ASPECT 1
Currently, there are 24 specific conditions (+PlaceholderAPI variables) but you can combine them. You can set a player level condition, a world condition, and even a condition for NOT executing commands if there are certain entities nearby the player!
Execution Mode
You can also check if a player has accomplish one condition and if so, then it will execute a command (or multiple commands) from the console to that player. This feature is similar to the /testfor command.
This plugin also allows you to create commands with cooldowns and delayed commands. Even you can create your own commands. There are many other things that you can see below in detail.
- ✓ 25+ Conditions:
- Members of the Faction
- Power
- ✓ Editable Error Messages
- ✓ Editable Success Messages
- ✓ Editable Success Sounds and Error Sounds
- ✓ Editable Success Commands and Error Commands
- ✓ Messages with variables
- ✓ Easy to use (Tutorial below)
- ✓ Works with 1.8+
To start creating your own conditions, you need to go to the config. You'll see a lot of default conditions. You can remove all of them but make sure not to delete the Commands section.
IMPORTANT: If you want to test some conditions first you need to /deop yourself, because OP users bypass all of this conditions.
The commands conditions config follow this structure:
<section-name>:
This is not the command, is just the name of the section, you can name it as you want. Just be careful not to have sections with the same name.
<command>:
Here you need to put the command that will have the conditions. If you want to add a condition to the command "/warp" you can, but this means that all warps will have that condition. (/warp end, /warp survival). If you want to create a condition for specific one warp, use:
command: "/warp <arg>"
You can add the same condition for multiple commands by adding a ";" before the next command like this:
command: "/home;/tpa;/spawn;/warp"
If you want to set the condition below for ALL COMMANDS, just put:
command: "all"
(Why I would want this?)
For example you can add the condition of no enemies nearby. So, the player will not be able to execute ANY commands if there are Zombies, Skeletons... near him (radius editable).
You can add the variable %player% if you want to block some other specific commands like /give %player% command_block.
command: "/give %player% command_block"
error-message and success-message:
The error message will be sended to the player if he doesn't have the necessary requirements. The success message instead, will be sended to the player when the command is executed correctly. Here you can add multiples lines, so the message is fully editable.
You can delete the success message if you want, there is no problem with that.
There are specific variables you can use in the message. Each of these variables will be replaced with its corresponding value:
error-commands and success-commands:
You can execute other commands when player uses a command. These commands are executed from the console so you can use the %player% variable.
error-sound and success-sound:
You can play sounds for player when he executes a command. If the player accomplish the condition, the success-sound will play, if not, the error-sound.
SINCE MINECRAFT 1.13 CHANGED ALL IDS YOU NEED TO USE MATERIAL NAMES FROM THIS PAGE (SAME FOR SOUNDS):
Materials: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
Sounds: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
If you are using a 1.8.X server use these Sounds:
https://github.com/Attano/Spigot-1.8/-Redacted-/master/org/bukkit/Sound.java
If you are using a 1.9-1.12 server use these Sounds:
http://www.theredengineer.com/1.9-playsound-list.html
Conditions:
Of course, the most important thing of the plugin. Here you can find a tutorial of each of the created conditions.
Execution Mode:
This part is a little different to use, but is simple. With this feature, the plugin will check if the user accomplish one condition, and if so, a command will be executed from the console.
For example: If the player enters a certain location, you can define a command to teleport the player to another location. Or if the player reached level 30, you can give him money, send a specific message and whatever command you want.
Files:
Config.yml:
https://pastebin.com/TJKjGKsP
API:
Currently the plugin have a very small API.
For this to work you need to add my plugin to your plugin external jars dependencies and to set softdepends: CommandConditions on your plugin.yml file
COMMANDS:
-/coc info Shows plugin info
-/coc reload Reload the plugin config
-/coc execute <condition> <player>
This command allows you to verify a condition of the config on a player. If the condition fails, all options related to errors will be executed (error-sounds, error-messages, error-commands). If succeeded, these options will be executed (command, success-messages, success-sounds, success-commands)
PERMISSIONS:
Just one: coc.admin
Please avoid posting bad ratings before asking. If you have problems or bugs with the plugin contact with me or post on the plugin discussion and I will take a look at it.
Tested Minecraft Versions: 1.8 / 1.9 / 1.10 / 1.11 / 1.12 / 1.13 / 1.14 / 1.15 / 1.16
ATTENTION: NO MORE FUNCTIONALITIES WILL BE ADDED TO THIS PLUGIN, THAT MEANS NO MORE UPDATES UNLESS IT IS SOMETHING RELATED TO BUGS/ERRORS.
What can I do with CommandConditions?
This plugin allows you to create specific requirements to execute different kind of commands. For example, you can create a condition for the command "/warp end" to teleport the player to The End. But the command will not execute, if the player doesn't have an enderpearl called "Ender Teleporter" with enchantment FIRE_ASPECT 1
Currently, there are 24 specific conditions (+PlaceholderAPI variables) but you can combine them. You can set a player level condition, a world condition, and even a condition for NOT executing commands if there are certain entities nearby the player!
Execution Mode
You can also check if a player has accomplish one condition and if so, then it will execute a command (or multiple commands) from the console to that player. This feature is similar to the /testfor command.
This plugin also allows you to create commands with cooldowns and delayed commands. Even you can create your own commands. There are many other things that you can see below in detail.
- ✓ 25+ Conditions:
- Item Required
- Level Required
- Permission Required
- Add Warning Message (Before executing the command, with GUI option too!)
- Money Required (Vault)
- Player must be on specific world
- Player must be on specific location (coordinates)
- No specific Entities nearby
- Time played on server required
- No in specific Gamemode
- Add Cooldown to a command
- Add Delay to a command
- Jobs Level/Job Required (JobsReborn)
- Factions Conditions
- Members of the Faction
- Power
- Players Connected
- Health Condition
- BattleLevels level required
- WorldGuard region (7.x not supported)
- No Items in Inventory Condition
- Player above Block Condition
- Date Condition
- SkillAPI class and level required
- Biomes Condition
- Command From Console
- PlaceholderAPI support/variables
- ✓ Editable Error Messages
- ✓ Editable Success Messages
- ✓ Editable Success Sounds and Error Sounds
- ✓ Editable Success Commands and Error Commands
- ✓ Messages with variables
- ✓ Easy to use (Tutorial below)
- ✓ Works with 1.8+
To start creating your own conditions, you need to go to the config. You'll see a lot of default conditions. You can remove all of them but make sure not to delete the Commands section.
IMPORTANT: If you want to test some conditions first you need to /deop yourself, because OP users bypass all of this conditions.
The commands conditions config follow this structure:
Code:
Commands:
<section-name>:
command: "<command>"
conditions:
condition1
condition2
....
error-message:
- '<message-line1>'
- '<message-line2>'
- ...
success-message:
- '<message-line1>'
- ...
<section-name>:
This is not the command, is just the name of the section, you can name it as you want. Just be careful not to have sections with the same name.
<command>:
Here you need to put the command that will have the conditions. If you want to add a condition to the command "/warp" you can, but this means that all warps will have that condition. (/warp end, /warp survival). If you want to create a condition for specific one warp, use:
command: "/warp <arg>"
You can add the same condition for multiple commands by adding a ";" before the next command like this:
command: "/home;/tpa;/spawn;/warp"
If you want to set the condition below for ALL COMMANDS, just put:
command: "all"
(Why I would want this?)
For example you can add the condition of no enemies nearby. So, the player will not be able to execute ANY commands if there are Zombies, Skeletons... near him (radius editable).
You can add the variable %player% if you want to block some other specific commands like /give %player% command_block.
command: "/give %player% command_block"
error-message and success-message:
The error message will be sended to the player if he doesn't have the necessary requirements. The success message instead, will be sended to the player when the command is executed correctly. Here you can add multiples lines, so the message is fully editable.
You can delete the success message if you want, there is no problem with that.
There are specific variables you can use in the message. Each of these variables will be replaced with its corresponding value:
- %user-level%
- %user-world%
- %user-gamemode%
- %time-played%
- %user-money%
- %cooldown-time% (Use it when you have an item with cooldown)
- %job-level-<jobname>% (Replace <jobname> with a created job name)
- %factions-total%
- %factions-online%
- %factions-player-power%
- %player-health%
- %player-health-max%
- %user-battlelevel%
You can execute other commands when player uses a command. These commands are executed from the console so you can use the %player% variable.
Code:
date:
command: "/event"
conditions:
date:
- "day:SATURDAY,hour:16:00-20:00"
- "day-of-month:11"
error-message:
- '&4You can use this command just on Saturdays'
- '&4between 16:00 and 20:00 or the 11th of'
- '&4each month.'
success-commands:
- warp Event %player%
error-commands:
- someCommand
error-sound and success-sound:
You can play sounds for player when he executes a command. If the player accomplish the condition, the success-sound will play, if not, the error-sound.
Code:
abilities:
command: "/abilities"
conditions:
level-required: 30
permission: coc.abilities
error-message:
- '&4For using the &c&lAbilities Menu &4you need to be level 30+'
- '&4and to have the right permission.'
- '&8[&7Current Status&8]: &c%user-level%&7/&c30'
success-sound: BLOCK_NOTE_PLING;10;2
error-sound: BLOCK_GRASS_BREAK;10;0.5
SINCE MINECRAFT 1.13 CHANGED ALL IDS YOU NEED TO USE MATERIAL NAMES FROM THIS PAGE (SAME FOR SOUNDS):
Materials: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
Sounds: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
If you are using a 1.8.X server use these Sounds:
https://github.com/Attano/Spigot-1.8/-Redacted-/master/org/bukkit/Sound.java
If you are using a 1.9-1.12 server use these Sounds:
http://www.theredengineer.com/1.9-playsound-list.html
Conditions:
Of course, the most important thing of the plugin. Here you can find a tutorial of each of the created conditions.
<Item Required>
Description: You need a specific item to execute the command.
Usage:
<Permission Required>
Description: You need to have the right permission to execute the command
Usage:
<Add Warning Message>
Description: This is not really a condition, but its add a warning message before executing the command. Players must type a word or something to continue with the command.
Usage:
You can set "gui-inventory" to true to open an inventory where the user must select YES or NO. It works similar but is a more attractive way. I you set this option to true is not necessary to have a "continue" path, so you can remove it.
<Money Required>
Description: You need a certain amount of money to execute the command. If you want this option to work you need Vault on your server.
Link: https://dev.bukkit.org/bukkit-plugins/vault/
Usage:
#The amount of money required for executing the command
required: 5000
#If is true, the money will be taked from the players balance
take: true
<World>
Description: You need to be in a specific world to execute the command
Usage:
This means that the command "/factions" will be allowed only in the worlds: world, world_nether, world_the_end
<Location>
Description: You need to be in a specific location to execute the command
Usage:
If you set the radius to 0 it means that the user must be in a exact coordinate.
<Entities Nearby>
Description: There must not be entities nearby the player while executing the command
Usage:
This means that the player will fail teleporting to another place, if there are Zombies, Skeletons or Spiders nearby him, in a radius of 15 blocks.
<Time Played>
Description: You need to have played a certain amount of time on the server to execute the command
Usage:
<No In Gamemode>
Description: You don't have to be on this gamemode to execute the command
Usage:
This means that the player will be not able to execute any commands while in adventure mode.
<Cooldown>
Description: The player have to wait a certain amount of time (in seconds) before he can execute the command again
Usage:
<Delay>
Description: The command will be executed after a certain amount of time
Usage:
#If the delayed command should be canceled when the player moves
cancel-on-move: true
<Job Required>
Description: You need a certain job and level to execute this command. For this option to work, you need the plugin JobsReborn
Link: https://www.spigotmc.org/resources/jobs-reborn.4216/
Usage:
Remember to set a valid job name or the plugin will show an error.
<Factions Conditions>
Description: There are 3 factions conditions for now explained below. For this option to work, you need the plugin Factions
Link: https://dev.bukkit.org/projects/factions
Usage:
min-players: 5
The faction of the user who execute the command must have at least 5 members.
min-players-percentage-connected: 80
At least 80% of the members of the players faction must be connected to execute the command.
min-power: 10
The player must have 10 power to execute the command
Of course you can delete these conditions and just leave one, there is no problem with that.
<Players Connected>
Description: The command will execute only if there are a certain amount of players connected to the server
Usage:
<Health Condition>
Description: The command will execute only if you have a minimum or maximum percentage of health.
Usage:
In this case, the player need to have between 70% and 100% health, the "max: 100" is not really necessary, but I added it to show you that you can use min and max values. Of course you can delete the max or the min.
<BattleLevels Levels Required>
Description: You need to have a certain BattleLevels level to execute the command. Of course you need this plugin.
Link: https://www.spigotmc.org/resources/battlelevels.2218/
Usage:
<WorldGuard Region>
Description: The player needs to be on a certain WorldGuard region to execute the command.
For this option to work, you need the plugin WorldGuard
Link: https://dev.bukkit.org/projects/worldguard
Usage:
In this case the command /fly only can be executed on the regions: spawn and lobby1
<Residence Region>
Description: The player needs to be on a certain Residence region to execute the command.
For this option to work, you need the plugin Residence
Link: https://www.spigotmc.org/resources/residence-1-7-10-up-to-1-14.11480/
Usage:
In this case the command /efly only can be executed on the regions: test-lobby and test-lobby2
<No Items in Inventory>
Description: Your inventory must be empty to execute the command.
Usage:
<Player above Block>
Description: The player must be above a block to execute the command.
You can find a list of all blocks name here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
Usage:
<Biomes Condition>
Description: The player must be on certain biomes to execute the command.
You can find a list of all biomes names here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Biome.html
Usage:
<From Console Condition>
Description: The command must be executed from Console
Usage:
<Date Condition>
Description: The command can be executed just on a specific date:
Usage:
In this case, the /event command can be executed just on Saturdays between 16:00 and 20:00, or the 11th of each month.
In this example, the /event command can be executed everyday between 13:00 and 14:00.
<SkillAPI Class Required>
Description: You need to have a certain SkillAPI class and level to execute the command. You need this plugin:
Link: https://www.spigotmc.org/resources/skillapi.4824/
Usage:
<PlaceholderAPI Conditions>
Description: You can use all the variables you want from this plugin. Just be careful with the structure of the condition below. You need this plugin for this option to work: https://www.spigotmc.org/resources/placeholderapi.6245/
Usage:
- '&4You must have play at least 24 hours on the server to execute that command.'
The format or structure is the following:
- "VARIABLE;TYPE_OF_CONDITION;VALUE"
In this example the player must have play more than 1440 minutes on the server and be on the "lobby" world to execute the command.
You can also use PlaceholderAPI variables on Execution Mode, for example:
Description: You need a specific item to execute the command.
Usage:
warp_end:
command: "/warp end"
conditions:
item-required:
id: 368
amount: 1
name: "&d&lEnd &5&lTeleporter"
lore:
- "&7With this item you will be able to"
- "&7teleport you to the end whenever you like"
enchants:
- 'OXYGEN;5'
- 'FIRE_ASPECT;5'
on-hand: false
remove: false
ignore-enchants: false
ignore-lore: false
error-message:
- '&4For teleporting to the end you need the item: &d&lEnd &5&lTeleporter'[/CODE]
[/spoiler]
You can use color codes for the name and the lore. You can remove the name, lore and enchants paths if you want.
#If the player needs to have the item on hand to execute the command
on-hand: false
#If the item will be removed from the player inventory after executing the command
remove: false
#You can ignore checking some attributes of the items to compare (For example when an item can have different enchants or lore)
ignore-enchants: true
ignore-lore: true
ignore-durability: true
[IMG alt="[IMG]"]http://i.imgur.com/rMMfefe.gif[/IMG]
[B]<Level Required>[/B]
Description: You need to have a certain level to execute the command
Usage:
[spoiler='Usage']
[ICODE]
abilities:
command: "/abilities"
conditions:
level-required: 30
<Permission Required>
Description: You need to have the right permission to execute the command
Usage:
abilities:
command: "/abilities"
conditions:
permission: coc.abilities
Description: This is not really a condition, but its add a warning message before executing the command. Players must type a word or something to continue with the command.
Usage:
suicide:
command: "/suicide"
conditions:
warning:
message:
- '&cAre you sure you want to execute that command?'
- '&aType &7"YES&7" &ato continue or anything else to cancel.'
continue: "YES"
gui-inventory: false
You can set "gui-inventory" to true to open an inventory where the user must select YES or NO. It works similar but is a more attractive way. I you set this option to true is not necessary to have a "continue" path, so you can remove it.
<Money Required>
Description: You need a certain amount of money to execute the command. If you want this option to work you need Vault on your server.
Link: https://dev.bukkit.org/bukkit-plugins/vault/
Usage:
announce:
command: "/announce"
conditions:
warning:
message:
- '&cAre you sure you want to execute that command?'
- '&cThis is going to take you &2$5000&c.'
- '&aType &7"YES&7" &ato continue or anything else to cancel.'
continue: "YES"
money-required:
required: 5000
take: true
error-message:
- '&4You need &2&l$5000 &4to execute this command'
- '&8[&7Current Status&8]: &c$%user-money%&7/&c$5000'
success-message:
- '&bYou have executed the command correctly for &2&l$5000'
- '&bNow you have: &c$%user-money%'
#The amount of money required for executing the command
required: 5000
#If is true, the money will be taked from the players balance
take: true
<World>
Description: You need to be in a specific world to execute the command
Usage:
factions_enable_in_worlds:
command: "/factions"
conditions:
worlds:
- "world"
- "world_nether"
- "world_the_end"
error-message:
- '&4You are not allowed to execute that command on this world!'
- '&8[&7Current World&8]: &c%user-world%'
<Location>
Description: You need to be in a specific location to execute the command
Usage:
specific_location:
command: "/enchant"
conditions:
location:
world: world
x: 0
y: 60
z: 0
radius: 2
error-message:
- '&4You are not allowed to execute that command on this location!'
<Entities Nearby>
Description: There must not be entities nearby the player while executing the command
Usage:
enemies_nearby:
command: "/home;/spawn;/warp;/tpa"
conditions:
no-entity-nearby:
entities:
- ZOMBIE
- SKELETON
- SPIDER
radius: 15
error-message:
- '&4You can not use that command because there are enemies nearby!'
<Time Played>
Description: You need to have played a certain amount of time on the server to execute the command
Usage:
time_played:
command: "/warp epic-items"
conditions:
time-played: 3600
error-message:
- '&4You need to have played 1 hour on the server to execute this command!'
- '&8[&7Time Played&8]: &c%time-played%'
<No In Gamemode>
Description: You don't have to be on this gamemode to execute the command
Usage:
gamemode:
command: "all"
conditions:
no-gamemode: ADVENTURE
error-message:
- '&4You can not use any commands while in Adventure Mode!'
<Cooldown>
Description: The player have to wait a certain amount of time (in seconds) before he can execute the command again
Usage:
daily_reward_cooldown:
command: "/daily-reward"
conditions:
cooldown: 86400
error-message:
- '&4You need to wait &c%cooldown-time% &4to use that command again!'
<Delay>
Description: The command will be executed after a certain amount of time
Usage:
spawn:
command: "/spawn"
conditions:
delay:
amount: 3
cancel-on-move: true
message: '&7The command will be executed on: &6%time% &7seconds. Don''t move!'
#If the delayed command should be canceled when the player moves
cancel-on-move: true
<Job Required>
Description: You need a certain job and level to execute this command. For this option to work, you need the plugin JobsReborn
Link: https://www.spigotmc.org/resources/jobs-reborn.4216/
Usage:
jobs:
command: "/mining-shop"
conditions:
jobs:
- 'Miner,15'
error-message:
- '&4You need to be Miner lvl 15+ to execute this command'
- '&8[&7Current Status&8]: &c%job-level-Miner%&7/&c15'
Remember to set a valid job name or the plugin will show an error.
<Factions Conditions>
Description: There are 3 factions conditions for now explained below. For this option to work, you need the plugin Factions
Link: https://dev.bukkit.org/projects/factions
Usage:
faction-conditions:
command: "/factions-shop"
conditions:
factions:
min-players: 5
min-players-percentage-connected: 80
min-power: 10
error-message:
- '&4Your faction need to have more than 5 players and at least 80% of them must be connected.'
- '&4Also you need to have 10 power to execute that command.'
- '&8[&7Factions Players&8]: &c%factions-total%&7/&c5'
- '&8[&7Factions Online Players&8]: &c%factions-online%&7/&c%factions-total%'
- '&8[&7Power&8]: &c%factions-player-power%&7/&c10'
min-players: 5
The faction of the user who execute the command must have at least 5 members.
min-players-percentage-connected: 80
At least 80% of the members of the players faction must be connected to execute the command.
min-power: 10
The player must have 10 power to execute the command
Of course you can delete these conditions and just leave one, there is no problem with that.
<Players Connected>
Description: The command will execute only if there are a certain amount of players connected to the server
Usage:
minplayers:
command: "/warp event"
conditions:
min-players: 20
error-message:
- '&4There must be at least 20 players online to teleport you to that location'
<Health Condition>
Description: The command will execute only if you have a minimum or maximum percentage of health.
Usage:
health:
command: "/warp pvp"
conditions:
health:
min: 70
max: 100
error-message:
- '&4You need to have at least 70% of your health to teleport you there'
- '&8[&7Current Status&8]: &c%player-health%&7/&c%player-health-max%'
In this case, the player need to have between 70% and 100% health, the "max: 100" is not really necessary, but I added it to show you that you can use min and max values. Of course you can delete the max or the min.
<BattleLevels Levels Required>
Description: You need to have a certain BattleLevels level to execute the command. Of course you need this plugin.
Link: https://www.spigotmc.org/resources/battlelevels.2218/
Usage:
abilities2:
command: "/battle-abilities"
conditions:
battlelevels:
level-required: 5
error-message:
- '&4For using the &c&lBattle Abilities Menu &4you need to be level 5+'
- '&8[&7Current Status&8]: &c%user-battlelevel%&7/&c5'
<WorldGuard Region>
Description: The player needs to be on a certain WorldGuard region to execute the command.
For this option to work, you need the plugin WorldGuard
Link: https://dev.bukkit.org/projects/worldguard
Usage:
worldguard:
command: "/fly"
conditions:
worldguard-regions:
- spawn
- lobby1
error-message:
- '&4You can fly only on these areas:'
- '&7-> Spawn'
- '&7-> Minigames Lobby'
<Residence Region>
Description: The player needs to be on a certain Residence region to execute the command.
For this option to work, you need the plugin Residence
Link: https://www.spigotmc.org/resources/residence-1-7-10-up-to-1-14.11480/
Usage:
residence:
command: "/efly"
conditions:
residence-regions:
- test-lobby
- test-lobby2
error-message:
- '&4You can fly only on these areas:'
- '&7-> Test Lobby'
- '&7-> Test Lobby 2'
In this case the command /efly only can be executed on the regions: test-lobby and test-lobby2
<No Items in Inventory>
Description: Your inventory must be empty to execute the command.
Usage:
no-items-on-inventory:
command: "/warp parkour"
conditions:
no-items: true
error-message:
- '&4If you want to teleport to the parkour, first'
- '&4you need to clear your inventory.'
<Player above Block>
Description: The player must be above a block to execute the command.
You can find a list of all blocks name here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
Usage:
execution-mode-test4:
command: "/eco give %player% 1500;/msg %player% &2Congrats on finishing the parkour!;/warp lobby %player%"
execution-mode:
enabled: true
one-time: true
conditions:
above-block: DIAMOND_BLOCK
<Biomes Condition>
Description: The player must be on certain biomes to execute the command.
You can find a list of all biomes names here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Biome.html
Usage:
specific_biome:
command: "/biome_example"
conditions:
biomes:
- MESA
- MESA_ROCK
- MESA_CLEAR_ROCK
error-message:
- '&4You need to be on Mesa Biome to execute that command!'
<From Console Condition>
Description: The command must be executed from Console
Usage:
console_command:
command: "/op"
conditions:
from-console: true
error-message:
- '&4This command must be executed from console!'
<Date Condition>
Description: The command can be executed just on a specific date:
Usage:
date:
command: "/event"
conditions:
date:
- "day:SATURDAY,hour:16:00-20:00"
- "day-of-month:11"
In this case, the /event command can be executed just on Saturdays between 16:00 and 20:00, or the 11th of each month.
date:
command: "/event"
conditions:
date:
- "hour:13:00-14:00"
In this example, the /event command can be executed everyday between 13:00 and 14:00.
<SkillAPI Class Required>
Description: You need to have a certain SkillAPI class and level to execute the command. You need this plugin:
Link: https://www.spigotmc.org/resources/skillapi.4824/
Usage:
warrior-abilities:
command: "/warrior-abilities"
conditions:
skillapi:
class: Warrior
level-required: 1
error-message:
- '&4For using the &c&lWarrior Abilities Menu &4you need to be level 1+ Warrior'
<PlaceholderAPI Conditions>
Description: You can use all the variables you want from this plugin. Just be careful with the structure of the condition below. You need this plugin for this option to work: https://www.spigotmc.org/resources/placeholderapi.6245/
Usage:
placeholderapi:
command: "/supermenu"
conditions:
placeholder_api:
- "%player_minutes_lived%;>=;1440"
- "%player_world%;equals;lobby"
error-message:
- '&4You must have play at least 24 hours on the server to execute that command.'
- '&4You must have play at least 24 hours on the server to execute that command.'
The format or structure is the following:
- "VARIABLE;TYPE_OF_CONDITION;VALUE"
In this example the player must have play more than 1440 minutes on the server and be on the "lobby" world to execute the command.
For Numbers:
==
!=
>=
<=
>
<
For Text:
equals
!equals
equalsIgnoreCase
!equalsIgnoreCase
==
!=
>=
<=
>
<
For Text:
equals
!equals
equalsIgnoreCase
!equalsIgnoreCase
jumps:
command: "/eco give %player% 1500;/msg %player% &2Congrats on jumping!!"
execution-mode:
enabled: true
one-time: true
conditions:
placeholder_api:
- '%statistic_jump%;>=;1250'
Execution Mode:
This part is a little different to use, but is simple. With this feature, the plugin will check if the user accomplish one condition, and if so, a command will be executed from the console.
For example: If the player enters a certain location, you can define a command to teleport the player to another location. Or if the player reached level 30, you can give him money, send a specific message and whatever command you want.
First of all there is a path on the config that you can change if you want.
execution-mode-check: 20
This defines how often the plugin will check for conditions. In this case the plugin will check for conditions every 20 TICKS. 20 Ticks = 1 second. I suggest you not to set it lower than 10 ticks or they can be lag issues.
This is how Execution mode works:
In this case the plugin will check if some user on the server reach level 30 and if so, 2 commands will be executed from the console. (You can use /msg %player% to send a message to the player, color codes supported). So, the player will receive money and a message telling him that he reached level 30. Of course you can add as many as you want.
Also, you can set all the plugin conditions you want except from Cooldown, Delay and Warning Message.
The one-time path means that the commands will be executed just one time. So, if the player loses his levels and he reached level 30 again, the commands will not be executed again.
Here is another example:
In this case the plugin will check if the user is on a certain location, and if so he will be teleported to another place and send him a message. The one-time path is set to false, so every time the user is on that location, the commands will be executed.
Another example:
This example has a recently added option called: "entry-leave-system" and it works only with WorldGuard regions conditions, location conditions ,Worlds conditions and Biomes conditions.
If you enable this option, a command will be sended just one time to the player when entering the region. When he leaves the region you can send him another command if the "leave command" is enabled.
execution-mode-check: 20
This defines how often the plugin will check for conditions. In this case the plugin will check for conditions every 20 TICKS. 20 Ticks = 1 second. I suggest you not to set it lower than 10 ticks or they can be lag issues.
This is how Execution mode works:
Code:
execution-mode-test1:
command: "/eco give %player% 5000;/msg %player% &4You reached level 30!!"
execution-mode:
enabled: true
one-time: true
conditions:
level-required: 30
Also, you can set all the plugin conditions you want except from Cooldown, Delay and Warning Message.
The one-time path means that the commands will be executed just one time. So, if the player loses his levels and he reached level 30 again, the commands will not be executed again.
Here is another example:
Code:
execution-mode-test2:
command: "/tp %player% -200 80 -200;/msg %player% &cYou have been teleported to a mysterious place..."
execution-mode:
enabled: true
one-time: false
conditions:
location:
world: world
x: 30
y: 60
z: 30
radius: 1
Another example:
Code:
execution-mode-test3:
command: "/msg %player% &cWelcome to the Shop!"
execution-mode:
enabled: true
one-time: false
entry-leave-system:
enabled: true
leave-command:
enabled: true
command: "/msg %player% &cBye! Have a nice day!"
conditions:
worldguard-regions:
- shop1
If you enable this option, a command will be sended just one time to the player when entering the region. When he leaves the region you can send him another command if the "leave command" is enabled.
Config.yml:
https://pastebin.com/TJKjGKsP
API:
Currently the plugin have a very small API.
For this to work you need to add my plugin to your plugin external jars dependencies and to set softdepends: CommandConditions on your plugin.yml file
JavaScript:
//Method that returns true if the player succeeded the condition (from the config file)
boolean condition = CommandConditionsAPI.executeCondition(Player player,String conditionPath);
COMMANDS:
-/coc info Shows plugin info
-/coc reload Reload the plugin config
-/coc execute <condition> <player>
This command allows you to verify a condition of the config on a player. If the condition fails, all options related to errors will be executed (error-sounds, error-messages, error-commands). If succeeded, these options will be executed (command, success-messages, success-sounds, success-commands)
PERMISSIONS:
Just one: coc.admin
Please avoid posting bad ratings before asking. If you have problems or bugs with the plugin contact with me or post on the plugin discussion and I will take a look at it.