Per-player buying limit per item
MarvinEads opened this issue ยท 5 comments
Love this plugin. Would be awesome if there was a way to configure a limit to how many of an item could be purchased daily.
Another user had another use case for a 'per player buying limit': They wanted to set up a christmas scavenger hunt, where the players have to find locations. When the players get there, they wanted to use a shopkeeper to hand out a reward item to the players. Players are meant to only collect each of these rewards once.
This is a rather specific use case that the Shopkeepers plugin is not suited for, nor supposed to be able to cover: Shopkeepers is not a general-purpose NPC plugin (like for example Citizens), but instead focuses on only one aspect: The setup of shops.
However, possible solutions to implement this scenario could be:
- Write a custom add-on plugin that keeps track if a player has already traded with a specific shopkeeper and then prevents further trades.
- Implement this without the Shopkeepers plugin. For example, one possible solution could be to set up a Citizens NPC that players have to interact with in order to receive their reward. Citizens allows admins to attach commands to a NPC, which are triggered when a player interacts with the NPC (https://wiki.citizensnpcs.co/NPC_Commands). Additionally, these NPC commands can be configured to require the clicking player to have a specific permission node attached. So one possible solution could be to give all players a certain custom permission node by default, and then add two commands to the Citizens NPC: One command that gives the player the reward item, but only if the player still has the required permission. And another command that removes the permission from the player. So once these commands have been triggered by a player, the player's permission is revoked to trigger the commands again.
There is already a ticket for something like this: #403
Maybe you can elaborate how exactly you would expect this feature to work, what kind of limit you want, how the limit gets setup, etc.
From #403 (comment)
Ok, same idea but I was thinking on the player ones, to prevent a player from buying up stock from every vendor on a server for the purposes of stocking their own shop at higher prices. The UI is nice and simple, hard to think of many ways to incorporate some limits. If another row can be added, maybe the user could put the same item there and increment/decrement same way as price and that could represent daily limits? cant think of a way to do anything that isnt just a daily limit tho. Probably have a configuration option for server op to determine if its applied to MC day, IRL day, or some other value. I probably have a limited view of the plugin since I am a player, can the Prev/Next nav be moved down on same row as name/delete to get another row
Possible variations I can currently think of would then be:
- Limit number of trades.
- Limit number of traded items.
- Whether this is a shared limit or a per-item (type) limit.
- Whether this limit only affects buying, or also selling.
- Whether this is a global limit, or a per-shop limit.
- Whether individual shops would be require to have different limits.
- Whether player shops would need to be required to setup their own limits.
- How the limit resets: Periodic full reset vs gradually.
- How the cooldown time is specified: Eg. globally inside the config, per item(type), per shop, per trade, etc..
The easiest to add would probably be to have a config section in which you can globally define buying limits for individual item types, together with a setting which specifies the time period in which the limit gets reset, and maybe a setting which specifies whether the limit resets gradually. The limit would be bound to real-time (system clock). So if the player leaves and joins the next day, his limits may have been reset in that time period.
A permission node for players which ignore the limit would make sense as well.
A setting for whether the limit affects admin-shops, player-shops, or both might make sense. And/or maybe a per-admin-shop toggle for whether the specific admin-shop is affected by the limit. Or there could be separate limits for player-shop and admin-shop trading.
However, storing the user-specific limits require storing user data. The plugin is not storing any user data yet, so this would need to be added first in order to be able to support a feature like this. I don't see this being added any time soon.
Edit: Thinking about this again, I am not sure a limit would actually help with your issue.
I was thinking on the player ones, to prevent a player from buying up stock from every vendor on a server for the purposes of stocking their own shop at higher prices.
Usually a player selling items does probably not care about who he is selling the items to, but only that he is able to sell all of his items. If a global limit were to be imposed, the selling player could bypass this by simply trading his items directly with other players, outside of a villager shop. I think a more realistic idea would be for the player selling items to increase his prices.. At some point you should end up with an equilibrium of what the stocking player is willing to buy the items for and what other players are willing to pay for these items.
From #727:
Hello,
Perhaps this is not common, but I run into issues on my server where players like to try to destroy the market by buying out all other shops and then reselling their goods at a lower price. Normally I would call this free market, but I get so many complaints about it that it would be nice for each player to block certain other players from using their shops.
I understand if this is not a highly desirable feature, but if you think it could be a good idea and that others would also benefit from it, it would be nice if you would consider adding it. This could also be used with Admin shops to prevent certain players from trading (for whatever reason, such as a punishment)
Thank you.
- Similar 'issue': Player buying out the market and causing 'disturbances' by that. Though, in this case the player ends up selling the items cheaper, which sounds less of a problem to me.
- The idea there is to let players setup per-shop player blacklists. This would be easier to implement.
- However, when players own multiple shops, configuring and maintining these per-shop blacklists might be inconvenient. Maybe a global per-player blacklist would be more convenient. This would, however, require storing per-player data, which the plugin does not have the capability for yet.
- Also, I am not sure if this would really solve the 'issue' (players can instruct other players to buy items for them; and this does not automatically account for new players following this scheme).
- Maybe a better solution would be to keep track of all trades, allow admins to globally configure certain per-item type limits, and limit players to buy more items than defined by this limit in a certain period of time. However, setting up and maintaining these limits for all kinds of items that might be affected by this issue would be inconvenient.
- Or allow players to only buy a certain percentage of the available items from each shopkeeper (this might be annoying for ordinary buyers with no bad intentions), or globally (however, this would be complex, and could still be easily bypassed if players group up).
- Another idea could be to not allow players to buy items which their own shops currently sell. And/or to impose a time limit for how long players need to wait to be able to setup a selling shop trade after they have bought a particular type of item (However, players unaware of this time limit would still cause the disturbance by buying out the market in the first place; and players can still simply trade these items by other means, outside of shopkeepers).
I agree with most of your responses. In the longer term is sorts itself out. I guess I see the problem being that longer term is a couple of months which is a long time for a MC players and certain items. Mind you, I have yet to come up with a reasonable code/UI solution, but a prime example would an elytra shop.
It takes a LONG time to collect a reasonable number of those to sell. If I price them at what I think my time is worth and am selling low enough that a newb can get one, it becomes a pain when someone decides they should be priced less, buys you out to sell them for less, and creates an artificially low price where no player wants to pay your price anymore because they are now worth the new price to everyone.
That kind of problem takes a long time to settle out. In the scenario above, what you said is exactly what happened tho, a group of people worked to accomplish this so knowing who all to stop them from buying you out is difficult.
Best thing I have in my head so far is some flag to say only 1 of an item can be bought per day vs unlimited, but figuring out how to get that into the UI cleanly isnt easy.