Shopkeepers

Shopkeepers

2M Downloads

Suggestion - hide out of stock trades

NightScythe1 opened this issue ยท 1 comments

commented

Would it be possible to add a config option to hide out-of-stock trades from the trading interface but not completely remove them? I.E. players opening the shopkeeper's inventory will not be able to see out of stock trades until they are restocked.
The reason I ask is I'm trying to set up a shop with random trades by using a loot table chest and hopper, and that rare items can occasionally pop up in the trading interface but will disappear again once bought.
If there's an easier way to do this, such as shops with random or rotating trades etc please let me know, and thanks in advance!

commented

The reason I ask is I'm trying to set up a shop with random trades by using a loot table chest and hopper

I am not completely sure I understand how this would be setup and work.

However, regardless of how easy it might be to add such a config option (I haven't checked yet), this sounds like you might be abusing player shops for a rather specific usecase which they are not intended for. The more appropriate and concrete way of implementing custom shopkeeper behavior (such as random or rotating trades) would be to write (or let write) an addon plugin and either add a new type of shopkeeper which implements this behavior, or periodically/under certain conditions update the trades of some shopkeeper programmatically.

Generally I try to avoid adding options, features and feature variations for usecases that are rather specific in order to keep the plugin easy to understand/use/configure and maintainable. Even though the addition of such a config option would probably not be to severe of an issue in that regards, I nevertheless hesitate to add something whose sole purpose is to be used for something that the plugin does not support / is not intended to be used for (player shops / the existing shop types are not supposed to support the described behavior / be used in this way).
I would much rather see this behavior being implemented explicitly as a new type of shopkeeper. But since I am rather buisy already I won't be able to implement this myself. And since this is rather specific it would better fit into a separate addon plugin rather than Shopkeepers directly.