Can I limit how many times command can be used in a day? #198


Open
  • wizirdi created this issue Mar 7, 2020

    Is there a way to  limit how many times command can be used in a day based on a permission group?

     

    So let's say default group can only use /rtp 5 times a day

     

  • Forge_User_57031538 posted a comment Mar 9, 2020

    I don't believe per day limiting is possible but you can set a cooldown in the command and define a permission for it and then give that permission to the group with your permission management plugin.

    Example for the command with 2h cooldown (cooldown is defined in seconds):

    'defaultrtp':
      command: /rspawn
      type: RUN_CONSOLE
      runcmd:
      - /rtp player $player
      - $text$&aWhoosh!
      cooldown: 7200
      register: true
      permission-required: true
      permission-node: mycommand.cmd.defaultrtp

  • ivanfromitaly posted a comment Mar 30, 2020

    You can do that using the playerdata feature. Check the dailybonus example, and expand it with another condition, who counts how many times the command got used.


To post a comment, please login or register a new account.