Skip to content

Condition commands

Sven Rahn edited this page Feb 13, 2019 · 15 revisions

Condition commands should be used with the /cu execute if ... command.

Is before & after

/cu is before <timestamp>
/cu is after <timestamp>

Returns SUCCESS if it is before or respectively after the specified timestamp. The timestamp must be in this format:

HH:mm:ss.SSS-dd.MM.yyyy
00:36:25.300-19.05.2018

Tip: You may want to use PlaceholderAPI for its JavaScript capabilities to generate a timestamp automatically, see this example.

Has money

/cu has money <playerName>|<playerUuid> <money>

Returns SUCCESS if the player has as much money as specified or more.

Has payed

/cu has payed <playerName>|<playerUuid> <money>

Returns SUCCESS if withdrawing the specified amount of money from the player's economy account was successful.

Has in hand

/cu has in hand <playerName>|<playerUuid> <item> [quantity = 1]

Returns SUCCESS if the player has the specified item in the main hand. Read this to learn more how you can specify an item.

If no quantity is given, it defaults to 1. If you set a higher quantity, the player must have at least that amount in the hand.

Has given from hand

/cu has given from hand <playerName>|<playerUuid> <item> [quantity = 1]

It is the same as /cu has in hand ... but also removes the specified item from the player's hand. This is useful for 'shop sell' commands. Read this to learn more how you can specify an item.

If no quantity is given, it defaults to 1. If you set a higher quantity, the player must have at least that amount in the hand.

Has in inventory

/cu has in inventory <playerName>|<playerUuid> <item> [quantity = 1]

Returns SUCCESS if the player has the specified item in the inventory. Read this to learn more how you can specify an item.

If no quantity is given, it defaults to 1. If you set a higher quantity, the player must have at least that amount in the inventory.

Has given from inventory

/cu has given from inventory <playerName>|<playerUuid> <item> [quantity = 1]

It is the same as /cu has in inventory ... but also removes the specified item from the player's inventory. Read this to learn more how you can specify an item.

If no quantity is given, it defaults to 1. If you set a higher quantity, the player must have at least that amount in the inventory.

Has permission

/cu has permission <playerName>|<playerUuid> <permission>

Returns SUCCESS if the player has the specified permission.

Has chance

/cu has chance <chance>

Returns the outcome of the random chance generator. The chance must be between 0.0 and 1.0. 0.8 means 80%.

Clone this wiki locally