There are 10 total conditions and you can use any number of them on every subcommand !
Every condition will have both a value field and a failureMessage field. The value field is the amount, so for cooldown, its the duration of the cooldown. The failureMessage field is the message sent to the player when the condition is not met.
Some conditions have a deduct field, which can be true or false. For example, health, if deduct is true, it will take away the players health.
cooldown
» The value field of cooldown is a number, and is the duration of the cooldown in ms.
» In the failure message, use {0} to display the time left in seconds.
Code (YAML):
subcommands:
default:
text
:
- 'Have a diamond'
commands
:
- 'give
%player% diamond 1'
conditions:
cooldown:
value
: 3000
failureMessage
: 'You have
{0
}s left of cooldown.'
cost
» Requires
Vault
» The value field in cost is a number, and is the amount of money the player need to use the command.
» Set deduct to true if you want the player to spend that money.
Code (YAML):
subcommands:
default:
text
:
- 'Have a diamond'
commands
:
- 'give
%player% diamond 1'
conditions:
cost:
value
: 10
deduct
: true
failureMessage
: 'You need 10$ to use this command.'
health
» The value field in cost is a number, and is the amount of health the player needs.
» 1 Health = half a heart
» Set deduct to true if you want the player to lose the health.
Code (YAML):
subcommands:
default:
text
:
- 'Have a diamond'
commands
:
- 'give
%player% diamond 1'
conditions:
health:
value
: 10
#5 hearts
deduct
: true
failureMessage
: 'You need 5 hearts to use this command.'
hunger
» The value field in cost is a number, and is the amount of hunger the player needs.
» 1 Hunger = half a bar
» Set deduct to true if you want the player to lose the hunger.
Code (YAML):
subcommands:
default:
text
:
- 'Have a diamond'
commands
:
- 'give
%player% diamond 1'
conditions:
hunger:
value
: 10
#5 bars
deduct
: true
failureMessage
: 'You need 5 hunger bars to use this command.'
inGroup
» Requires
Vault
» The value field in inGroup is a string, and is the name of a group the player is in.
» This checks if the player is in this group.
Code (YAML):
subcommands:
default:
text
:
- 'Have a diamond'
commands
:
- 'give
%player% diamond 1'
conditions:
inGroup:
value
: 'moderator'
failureMessage
: 'You dont have permission to use this command.'
isOp
» The value field is a boolean, so true or false.
» Checks if the player is an operator on the server.
Code (YAML):
subcommands:
default:
text
:
- 'Have a diamond'
commands
:
- 'give
%player% diamond 1'
conditions:
isOp:
value
: true
failureMessage
: 'You are not an operator!'
papi
» Requires
PlaceholderAPI
» The papi condition has it's own special field requirement called 'papi'. This field related to the placeholder to check against.
» The value field is a string and should be the wanted response when the placeholder is replaced.
» Any placeholder works as long as you have the correct expansions downloaded.
Code (YAML):
conditions:
papi:
papi
: '
%player_allow_flight%'
value
: '
yes'
failureMessage
: 'You need to be flying to use this command.'
permission
» The value field is a string and can be any permission node.
» Checks if the player has this permission.
Code (YAML):
subcommands:
default:
text
:
- 'Have a diamond'
commands
:
- 'give
%player% diamond 1'
conditions:
permission:
value
: 'some.permission.node'
failureMessage
: 'You dont have permission to do this.'
xp
» The value field is an integer and is an amount of xp the player needs.
» Set deduct to true if you want the player to lose the xp.
Code (YAML):
subcommands:
default:
text
:
- 'Have a diamond'
commands
:
- 'give
%player% diamond 1'
conditions:
xp:
value
: 5
deduct
: true
failureMessage
: 'You dont have enough xp to do this.'
xpLevel
» The value field is an integer and is the number of levels the player needs.
» Set deduct to true if you want the player to lose the levels.
Code (YAML):
subcommands:
default:
text
:
- 'Have a diamond'
commands
:
- 'give
%player% diamond 1'
conditions:
xpLevel:
value
: 5
deduct
: true
failureMessage
: 'You dont have enough levels to do this.'