Shopkeepers

Shopkeepers

2M Downloads

Possibility to limit which items can be sold in player shops

RolfKoenders opened this issue ยท 3 comments

commented

Hello Shopkeepers!

I would like to suggest a feature: Exclude items.
Basically what is says. Would it be possible to create a list of item names (Item displayName is enough probably) so that those items are not allowed to be used by players in the shopkeepers?

Use case: we have quite some custom items on our server and some of those shouldn't appear in players shopkeepers.

Thanks in advance!
Rolf

commented

Sound like this existing ticket to me: #417

Anyways, I do not fully understand your concrete use case yet, so maybe you can elaborate on that: What exactly makes these items special that you don't want your players to be able to trade them with one another? Be aware that you cannot prevent players from exchanging/trading their items directly with on another. So what problem would this exactly solve if players couldn't set up trades that involve these items?

Also, when you say "not allowed to be used by players in the shopkeepers", do you mean they cannot be used to setup trades, or that they cannot be used in the process of trading with shopkeepers (possibly including with admin shopkeepers)?

commented

Thanks for you reply @blablubbabc, i sure can!

I took a look at the ticket you mentioned #417 this sounds indeed really similar in the sense that it is indeed creating a blacklist.
You are of course correct, players could still drop their items and the other player can pick it up, no way in beating that.
On the server that we are running players can 'buy' certain items from a so called admin shop. For example for a couple diamonds players can buy a shopkeepers egg in order to setup their shop. This is to prevent shopkeeper spam, the bar is low but high enough that we don't see hundreds of them appear next to each other.
We also have other items, like special (custom) enchants and 'pets' they can buy from the admin shop that we don't want players to re-sell via a shopkeeper. For example we had a player buying some shopkeeper eggs and selling them for more diamonds then the server did and a couple players fell for it. The same situation as described before where players can just drop it for each other is still relevant but we encourage everyone to use the shopkeepers to trade/sell items to prevent these kind of scams. (people not dropping their items or not enough items).

It will not prevent players from doing it the original way, but it will prevent/protect the majority.

To answer your last question. I meant specifically to setup trades, i hadn't thought about the items used in the trade even though i can see that it might also be helpful. Personally i don't have a use case for that.

I hope that gives a bit more insight in why i thought a list of blacklisted/excluded items would be nice to have. If i can help in any other way please let me know!

commented

For example we had a player buying some shopkeeper eggs and selling them for more diamonds then the server did and a couple players fell for it.

Since this can apply to any items sold by admin shops, you would basically want to add all the items you sell in admin shops to this blacklist, right? For this use case, a setting to prevent players shops to trade/sell items that are sold by admin shops would probably be more convenient, since it would not require you to manually update the blacklist inside the config whenever you update the trades of admin shops. Or can you think of other use cases, in which the black list would contain items not sold by admin shops? Or cases in which you would not add the items to the blacklist even though they are sold by admin shops?

Also, you mentioned that you want to prevent players shops from selling these items. Or are you trying to ban these items completely from players shops (if yes, what would be the use case for that)? Can you think of cases in which one may want to have separate blacklists for selling and buying items in player shops (i.e. cases in which admin shops should be the only place where certain items can be sold)?

Regarding your use case: Be aware that you can have similar situations with players shops, where one player shop sells them cheaper than another, or one player even buying out the shops of other players to resell the items for higher prices.

Also be aware that trying to prevent this at least for the items sold by admin shops would mean that the plugin would have to compare the items of trades every time they are setup to all the items you are selling in admin shops (i.e. all the items you would add to the blacklist). I don't have any numbers on that, but this can end up being costly performance-wise. With the current implementation of the shop editor, these item comparisons would not only occur on actual trading recipe changes, but whenever a player opens and closes the editor, for all the trades inside the editor.
But there are certainly ways to optimize how often and for which trades these comparisons need to take place (for example by tracking which trades were modified inside the editor).