xCommands icon

xCommands -----

Create custom commands with great versatility and JSON support !




Hiya, just a small one today.

I've now added the ability to add a delay between messages and commands. All you need to do is add a line of text that has the value [wait=<time>] where <time> is a number of ticks. 20 ticks = 1 second.
I've also added a [blank] block that works in the same way. All it does is send and empty line of text.

Code (YAML):
subcommands:
  default
:
    text
:
    - 'You will get a diamond in 3'
     - ' [wait=20 ]'
     - '2 ...'
     - ' [wait=20 ]'
     - '1 ...'
     - ' [wait=20 ]'
     - 'NOW !!'
     - ' [blank ]'
    commands
:
    - ' [wait=60 ]'
     - 'give %player% diamond 1'
    conditions
: [ ]
If you have any bugs or suggestions put them in the discussion tab and I'll take a look ! The plugin should be 100% working for 1.20.4 also.

I've added the documentation tab at the top of the resource page for anyone that needs help with setting up their commands, it's not yet complete but should be a good start for anyone :)
----------, Jan 13, 2024

Hi ! I've now added even more conditions and 2 other types of cooldown !

Here are the 5 new conditions:
There's also a new option called deduct (not required, defaults to true) added inside of the following conditions:
- cost, health, hunger, xp, xpLevel
This allows you to decide if you want the player to lose the amount specified. Here's an example using the cost condition:
Code (YAML):
conditions:
  cost
:
    value
: 5
    deduct
: true
    failureMessage
: ' [ "", { "text": "» ", "bold":true, "color": "dark_gray" }, { "text": "You need $5 to run that command", "italic":true, "color": "red" } ]'
The new condition 'papi' allows you to take any papi placeholder you have installed and check it against whatever value you want (input as string in config). Here's an example of how this condition works within your command config:
Code (YAML):
conditions:
  papi
:
    papi
: ' %player_allow_flight%'
    value
: ' yes'
    failureMessage
: ' [ "", { "text": "» ", "bold":true, "color": "dark_gray" }, { "text": "You must be able to fly to use this command", "italic":true, "color": "red" } ]'
On top of this there is now a new cooldown option at the top of your config ! Its called 'globalCooldown', this allows you to have a server-wide cooldown which stops all players from using a command for however long you specify (in milliseconds, 1000ms = 1s)
Code (YAML):
# how often anyone can use this command (in milliseconds)
globalCooldown
: 5000
I've added an extra functionality to the commands section of your subcommand, you now have the option to run them as the player and not just the console. Here's how to do it:
Code (YAML):
commands :
  - 'give %player% diamond 1'
  - ' [player ] help'
Along with this there have been a few bug fixes and QOL changes:
  • A message in console will appear telling you what fields you're missing in your command's config file
  • Fixed a bug where it couldn't read numbers without a decimal place
  • Removed message for when there's no update found
Thank you for reading ! Put it in the discussion tab if you have any bugs or suggestions :)
----------, Oct 28, 2023

I've added conditions now! Every subcommand can have it's own set of conditions that the player has to meet. To start there are 5 conditions:
  • cost - Checks if a player has enough in their balance, requires Vault
  • isOp - Checks if the player is op
  • permission - Checks if a player has a specific permission
  • xp - Checks if the player has enough xp points
  • xpLevel - Checks if the player has enough xp levels
If you want any other conditions to be added, please put it in the discussion tab and I'll try to get to it as quick as I can !

Here's an example of how these can be added to your commands:
Code (YAML):
 youtube:
    tabComplete
: true
    default
:
      text
:
       - ' [ "", { "text": "» ", "bold":true, "color": "dark_gray" }, { "text": "Click ", "color": "red", "clickEvent": { "action": "open_url", "value": "https://youtube.com/" } }, { "text": "to open my ", "color": "gray", "clickEvent": { "action": "open_url", "value": "https://youtube.com/" } }, { "text": "Youtube", "bold":true, "color": "red", "clickEvent": { "action": "open_url", "value": "https://youtube.com/" } } ]'
      commands
: [ ]
      conditions
:
        cost
:
          value
: 5
          failureMessage
: ' [ "", { "text": "» ", "bold":true, "color": "dark_gray" }, { "text": "You need $5 to run that command", "italic":true, "color": "red" } ]'
        permission
:
          value
: 'some.permission'
          failureMessage
: ' [ "", { "text": "» ", "bold":true, "color": "dark_gray" }, { "text": "You dont have permission to do that.", "italic":true, "color": "red" } ]'
Along with this, I've added a new cooldown feature, where you can add a cooldown to you command if you want. The value is in milliseconds so 1 second of cooldown is 1000ms, heres an example:

Code (YAML):
enabled : true
name
: 'socials'

# effects whether your text will be processed as json or just as a string
json
: true

# permission node for your command, please set to 'none' if you dont need one
permission
: 'xcommands.command.socials'

# how often can someone use this command (in milliseconds)
cooldown
: 10000

# ban or only allow this command in certain worlds
worldWhiteList
:
 - "world"
worldBlackList
: [ ]
If you have any feature request or bug reports, leave it in the discussion and I'll get back to you as soon as i can.
----------, Oct 22, 2023

Resource Information
Author:
----------
Total Downloads: 251
First Release: Oct 22, 2023
Last Update: Jan 13, 2024
Category: ---------------
All-Time Rating:
4 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings