BS-SingleUse
SingleUse prevents players from buying specific items multiple times
SingleUse works with BossShop, the most player-friendly GUIShop Plugin!
Features
- Allows to limit the amount of uses of BossShop Items
- Configurable message (Default: '&cYou already bought this &6%limit%&c/&6%limit% &ctimes!')
- Lightweight
Commands
- None
Permissions
- None
Setup
All you need is the plugin BossShop and shops containing items.
You want to set an Item in a shop to a "Single-Use" Item?
Just add a "SingleUse: true" line to your item!
First:
GodApple: RewardType: item PriceType: money Price: 10000 Reward: - - type:GOLDEN_APPLE - amount:1 - durability:1 MenuItem: - type:GOLDEN_APPLE - amount:1 - name:&9%itemname% - 'lore:&cPrice: 10000 Money' - durability:1 Message: '&eYou bought 1 %itemname%! Money left: &c%left%' InventoryLocation: 9 ExtraPermission: ''
Then
GodApple: SingleUse: 1 RewardType: item PriceType: money Price: 10000 Reward: - - type:GOLDEN_APPLE - amount:1 - durability:1 MenuItem: - type:GOLDEN_APPLE - amount:1 - name:&9%itemname% - 'lore:&cPrice: 10000 Money#&4Only available once!!!' - durability:1 Message: '&eYou bought 1 %itemname%! Money left: &c%left%' InventoryLocation: 9 ExtraPermission: ''
Now your players will only be able to buy the item "GodApple" once.
@Blackixx
Ok, and next question. Is there any way to configure SingleUse per player or global?
@Jacold
exactly
Blackixx - I have a question.
If I set SingleUse more than 1 it will be sold defined times?
Example:
StackOfClay:
SingleUse: 6
/
\ Player can only buy 6 stacks and will retrieve message that clay is out of stock?
Request update 1.6.4 version, thanks!
@SereneKing
Update BossShop and BS-SingleUse
I seem to be running into an issue with BS Single Use. When I assign an item to inventory slot 10 I get null pointer exceptions due to it. I included the log of the server and the shop itself. Any ideas as to why this may be doing it?
@Seaboiii
I achieve this by requiring a permission for the item, then adding a negative permission to the player after the item is bought. With the BS config set to only show what you have permission for it makes the item disappear. But to do this you have to have your reward as a command or permission. So it is a bit limiting. Would be a great feature.
@CommodoreAlpha
Both features are going to be added, thanks! I'm currently working on a huge BossShop rework and many nice improvements.
@CommodoreAlpha
Yeah. Configurable amount of times is good. The 2nd idea of @CommodoreAlpha is also a nice addition to BossShop
Normally, what makes a plugin a well-designed plugin is that it uses variables rather than constants. So in this situation, instead of being limited to either making items a one-time or infinite-time purchase, it would be great if one could make a certain item purchasable up to "x" times.
From the looks of this plugin, I know you're trying to keep simplicity, but I don't think it would hurt to replace the current "singleuse: true" variable with a "purchasable: <integer>" value.
Also, what @Seaboiii suggested sounds like a fantastic idea.
Now, for another idea, albeit this is far more complicated and I'm just throwing this out there for the sake of throwing. After an "item" gets bought "x" times and "disappears" from the menu, perhaps it could be replaced by an entirely different "item"? This could allow for a few novel ideas, like "upgrades", where you purchase a permission node called "level.1", then the item disappears and is replaced by a new purchasable permission node called "level.2". Or, you make it so that after purchasing the single-time "God Apple", it gets replaced by "Lesser Apples" which can be bought infinitely. The ideas as to what you can do with this "replacement system" are limited by your imagination, really.
Is it possible for the item in the shop to vanish once we bought it once?