LimitedUses [BSP] - Allows to limit the amount of uses of shop items v1.1.0

This BossShopPro Addon allows to limit the amount of uses of items by adding a new type of condition

  1. Blackixx
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    Source Code:
    https://github.com/Blackixx/BSP-LimitedUses
    LimitedUses
    This BossShopPro Addon allows to limit the amount of uses of items by adding a new type of condition.


    Features

    • Adds a new conditions:
      • "uses" - Conditions based on the amount of previous purchases
      • "cooldown" - Give items a purchase-cooldown (in seconds)
    • Placeholders:
      • %uses% - Displays the amount of previous uses
      • %uses_<shop name>:<shopitem name>% - Displays amount of uses of a specific shopitem anywhere
      • %cooldown_<shop name>:<shopitem name>% - Displays remaining cooldown time of a specific shopitem anywhere
    • Super lightweight
    [​IMG]


    Commands
    (Optional; can for example be used to allow players to purchase more shopitem uses)
    • lius set <player> <shop> <shopitem> <count>
    • lius add <player> <shop> <shopitem> <count>
    • lius remove <player> <shop> <shopitem> <count>
    • lius reset <player> <shop> <shopitem>
    • lius reset <player>
    • lius resetall
    Requires the permission "LimitedUses.Modify".


    Example configuration:
    Code (Text):
      Obsidian:
        MenuItem:
        - type:OBSIDIAN
        - amount:64
        - name:&964 Obsidian
        - 'lore:&cPrice: %price%#&eBought: &4%uses%/10 &etimes.'
        RewardType: ITEM
        Reward:
        - - type:OBSIDIAN
          - amount:64
        PriceType: MONEY
        Price: 10000
        Message: '&eYou bought %reward%! Money left: &c%left%'
        ExtraPermission: ''
        InventoryLocation: 7
        Condition:
        - type:uses
        - below:10
    Code (Text):
    # This is an example shop, demonstrating the LimitedUses addon
    ShopName: LimitedUses
    DisplayName: '&4&lLimitedUses'
    Command: limiteduses
    signs:
      text: '[LimitedUses]'
      NeedPermissionToCreateSign: true
    shop:
      Diamond:
        MenuItem:
        - type:DIAMOND
        - amount:1
        - name:&dDiamond
        - 'lore1:&8You can purchase one diamond every ten hours.'
        - 'lore2:&cPrice: %price%.'
        RewardType: ITEM
        Reward:
        - - amount:1
          - type:DIAMOND
        PriceType: MONEY
        Price: 150.0
        Message: '&eYou bought a diamond for %price%.'
        ExtraPermission: ''
        InventoryLocation: 1
        Condition:
        - type:cooldown
        - over:36000
      Diamond_blocked:
        MenuItem:
        - type:BARRIER
        - amount:1
        - name:&f&lOut of stock
        RewardType: NOTHING
        PriceType: NOTHING
        Message: '&8Come back in %cooldown_LimitedUses:Diamond%.'
        ExtraPermission: ''
        InventoryLocation: 1
      StarterKit:
        MenuItem:
        - type:WOOD_PICKAXE
        - amount:1
        - name:&fStarter Kit
        - 'lore:&8Click to receive your starter kit.'
        RewardType: ITEM
        Reward:
        - - amount:1
          - type:WOOD_PICKAXE
        - - amount:1
          - type:WOOD_SPADE
        - - amount:1
          - type:WOOD_AXE
        - - amount:1
          - type:WOOD_SWORD
        - - amount:16
          - type:TORCH
        - - amount:32
          - id:4
        PriceType: NOTHING
        Message: '&eReceived your starter kit.'
        ExtraPermission: ''
        InventoryLocation: 2
        Condition:
        - type:uses
        - under:1
      StarterKit_blocked:
        MenuItem:
        - type:BARRIER
        - amount:1
        - name:&f&lOut of stock
        - 'lore:&cYou have already taken your starter kit.'
        RewardType: NOTHING
        PriceType: NOTHING
        Message: ''
        ExtraPermission: ''
        InventoryLocation: 2
      Obsidian:
        MenuItem:
        - type:OBSIDIAN
        - amount:64
        - name:&964 Obsidian
        - 'lore1:&cPrice: 10000 Money'
        - 'lore2:&cBought: &b%uses%&c/&b15 &ctimes.'
        RewardType: ITEM
        Reward:
        - - type:OBSIDIAN
          - amount:64
        PriceType: MONEY
        Price: 10000
        Message: '&eYou bought %reward%! Money left: &c%left%'
        ExtraPermission: ''
        InventoryLocation: 3
        Condition:
        - type:uses
        - under:15

Recent Reviews

  1. jacked1900
    jacked1900
    5/5,
    Version: v1.1.0
    great plugin but i have some problems. Is it possible to set the player to buy 10 items every 24 hours? second thing, the message is displayed like this:
    Come back in% cooldown_LimitedUses: Diamond%.
  2. DanDanisme
    DanDanisme
    5/5,
    Version: v1.1.0
    Can you add
    No UUID mode
    The cooldown will be refreshed after players log in multiple times
  3. LeBraiden
    LeBraiden
    4/5,
    Version: v1.1.0
    Good stuff man, however for some reason when using the cooldown feature the item will disappear for the time its on cooldown, i think this is intentional but i don't like it, and if there's no way to turn that off implementing that would be really nice :)
  4. QingNiao
    QingNiao
    4/5,
    Version: v1.1.0
    Downstream paperclip-149.jar

    Plugin LimitedUses v1.1.0 does not specify an api-version.
  5. ERROR_SANS2004
    ERROR_SANS2004
    5/5,
    Version: v1.1.0
    [SPANISH]
    Gran recurso, hay alguna manera de que cuando hayas hecho por ejemplo 5 usos poner una recompensa/comando?
    Espero su respuesta :D
    1. Blackixx
      Author's Response
      Hey, thanks for the rating.
      Having a command that is (manually) executed after a player bought an item 5 times is possible:
      - Set uses limit to 5
      - Place a second shop item in the same slot as your first item and set its reward to that command (the player will have to manually click it to have an effect though)
      - If you want the command to be executed just once, set the limit of the command shop item to 1, preventing the player from clicking it multiple times
  6. trevor1800
    trevor1800
    5/5,
    Version: v1.1.0
    This is probably the best addon I have ever seen for the BossShopPro plugin, helps a lot when making a kits GUI and giving them a cooldown message, very good job mate.
    1. Blackixx
      Author's Response
      Thanks for the review :)
  7. FlailoftheLord
    FlailoftheLord
    5/5,
    Version: v1.0.5
    Finally, was looking for something like this,
    Its funny it was right here the whole time.
    Love it! <3
    1. Blackixx
      Author's Response
      Thank you :)
  8. EpicBeasto111
    EpicBeasto111
    5/5,
    Version: v1.0.5
    Radical Addon for a Radical Plugin. Could you perhaps include an example of how to use cooldowns in the config? If I could see it in an example, I'm sure I could catch on to how its used. Thanks!
    1. Blackixx
      Author's Response
      Thanks :) The example shop on the main addon page contains a cooldown example.
  9. leoblanquez
    leoblanquez
    5/5,
    Version: v1.0.4
    Awesome plug in. Just one thing how do you get the cooldowns to work? I get Message: '&8Come back in %cooldown_LimitedUses:Diamond%.'
    1. Blackixx
      Author's Response
      Thanks for the review. If you have questions please contact me via Spigot PM :)
  10. helomi
    helomi
    5/5,
    Version: v1.0.3
    The best plugin and developer i've ever seen.
    (Feathure request)
    Its possible add command for cooldowns too?
    For example:
    lius set <player> <shop> <shopitem> <cooldown> <tipe>
    Type: I mean seconds, minutes, hours etc.
    1. Blackixx
      Author's Response
      Thanks & good idea.