⏲ CMDLimiter | Max Uses - Conditions icon

⏲ CMDLimiter | Max Uses - Conditions -----

Create a custom command with restrictions



Code (YAML):
requirements:
  custom_name
:
    type
: "=="
    input
: "currentDate"
    output
: "18.07.2024 16:00:00"
    denyMessage
: "&c&l[!] &fYour custom message here."
 
Explanation of Each Field:
  1. custom_name:
    This is a unique name you assign to each condition. You can create as many conditions as needed, each with its own name.

  2. type:
    Select the comparison operator to use. Common operators include:
    • == : Equals (e.g., checking if two values are the same).
    • != : Not equals (e.g., checking if two values are different).
    • > : Greater than.
    • < : Less than.
    • >= or => : Greater than or equal to.
    • <= or =< : Less than or equal to.
  3. input:
    Specify what you want to compare. This can be:
    • currentDate: If you're checking the date.
    • permission: If you're checking player permissions.
    • %player_allow_flight%: Any placeholder (e.g., from PlaceholderAPI) that gives dynamic values like player stats.
  4. output:
    Set the value that input is compared to. Depending on input, this could be:
    • A date in the format "18.07.2024 16:00:00" for date checks.
    • A permission string like "cmdlimiter.free" for permission checks.
    • The expected value from a placeholder (e.g., "no" if checking if a player is not flying).
  5. denyMessage:
    This is an optional field. If included, it specifies the message shown to the player if the condition is not met. If left out, the plugin will simply block the command without a message.
If you don't need to use conditions, you can remove the whole requirements + minimumRequirements section.

You can use HEX, GRADIENTS and RAINBOW COLORS:
HEX COLOR: <SOLID:00FFD3>TEXT
[​IMG]
GRADIENT COLOR: <GRADIENT:2C08BA>TEXT</GRADIENT:028A97>
[​IMG]
RAINBOW COLOR: <RAINBOW1>TEXT</RAINBOW>
[​IMG]

PS: You must have 1.16.5+ server version!

Code (YAML):

updateChecker
: true
dateFormat
: "dd.MM.yyyy HH:mm:ss" # required restart

commands
:
  free
:
    description
: "Command for free Items"

    console
:
     - "give %player% diamond 1"
      - "give %player% emerald 1"

    maxUse
: 3

    minimumRequirements
: 3

    requirements
:
      commandExpirationCheck
:
        type
: "<=" # currentDate <= 18.07.2024 16:00:00 -> is Before ?
        input
: "currentDate"
        output
: "22.08.2024 13:00:00"
        denyMessage
: "&c&l[!] &fThis command is expired!"
      permissionCheck
:
        type
: "!=" # permission != cmdlimiter.free
        input
: "permission"
        output
: "cmdlimiter.free"
        denyMessage
: "&c&l[!] &fThere must be more than 1 player on the server"
      flyCheck
:
        type
: "=="
        input
: "%player_allow_flight%"
        output
: "no"
        denyMessage
: "&c&l[!] &fYou can't use this command while you are flying"


    use
: "&fYou got a &bdiamond &fand &aemerald&f."
    used
: "&c&l[!] &fYou reached max uses"

    join
:
      enabled
: true
      message
:
       - "&e--------------------"
        - "&fYou didn't pick up your free reward"
        - "&fUse &e/free"
        - "&e--------------------"

help
:
 - "&c&lCMDLimiter HELP"
  - "&f- &c/cmdlimiter reload &fReloads the config.yml and data.yml files."
  - "&f- &c/cmdlimiter set <player> [command] <uses> &fSets the number of uses for a specific player."
commandUsage
: "&c&l[!] &fUsage: &c/%command%&f!"

reloading
: "&c&l[!] &fThe &cCMDLimit &fplugin is &creloading&f!"
reloadComplete
: "&a&l[!] &fCMDLimit reload is &acomplete&f!"
dataSaved
: "&a&l[!] &fCMDLimit data saved&f!"
setPlayerUses
: "&a&l[!] &fPlayer &a%player% &fnow has &a%uses% &fuses in &a/%command%&f."

onlyForPlayer
: "&c&l[!] &fThis command is only for player."
playerNotFound
: "&c&l[!] &fPlayer &c%player% &fnot found!"
commandNotFound
: "&c&l[!] &fCommand &c%command% &fnot found!"
noPermission
: "&c&l[!] &fYou don´t have permission to use &c/%command%&f!"
 
Resource Information
Author:
----------
Total Downloads: 223
First Release: Feb 25, 2022
Last Update: Aug 22, 2024
Category: ---------------
All-Time Rating:
4 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings