Shopkeepers

Shopkeepers

2M Downloads

Feature: Per-player discounts (or decrease the price after many trades)

FnefI opened this issue ยท 5 comments

commented

Preliminaries:

  • Shopkeepers version: <Insert Shopkeepers version>
  • Spigot version: <Insert output of /version command>

  • I have checked that my issue/question does not get answered by:
  • I have checked all open and closed issues, but none seems to fit my issue/question.

Reproduction on a fresh and up-to-date Spigot server:

I was <able / not able> to reproduce my issue on a freshly set up and up-to-date Spigot server (currently <Insert output of /version command on up-to-date Spigot server>) with the latest version of Shopkeepers (currently <Insert latest tested Shopkeepers version>), with no other plugins and with no kinds of other server or client mods.

The issue:

Provide a detailed description of your problem and add as much information as possible which could help to reproduce the issue.

Include:

  • Description of the issue.
  • Step-by-step instructions on how to reproduce the issue.
  • Observed behavior.
  • Expected behavior.
  • If items with special attributes are involved: Include instructions on how to create those items.
  • Server logs (from server startup until issue). Consider enabling debug mode in the config for additional console output.
  • If modified from default: Plugin configurations.
  • ... Anything else that might be useful to reproduce and identify the issue.
commented

Oow

commented

I have reduced this ticket to the "per-player discounts" request. The "change price depending on the number of trades" request can be discussed as a separate ticket if there is the need. But this would require tracking player trades, which I try to avoid.

Maybe you can clarify your usecases for these requests. I.e. why do you even want different players to have different trading conditions? Maybe there are other ways to achieve the goal that don't require a new feature to be implemented.

For example, it is currently already possible to restrict access to specific admin shopkeepers to players that have a particular permission node assigned. So you could already setup a separate admin shopkeepers that offers similar trades as another, but with discounted conditions, that can only be accessed by certain players.
Another idea could be setup those two shopkeepers and use a Citizens NPC to remotely open (via the /shopkeeper remote <id> command) the shopkeeper corresponding to the player interacting with the NPC: I think it is possible to attach multiple commands to a Citizens NPC and assign permissions to them: If a player interacts with the NPC, the normal shopkeeper is opned. If the player has the necessary permission node, the command to open the discounted shopkeeper is run, replacing the normal shopkeeper trading menu.

Regarding implementing per-player discounts as a new feature:
Configuring something like this conveniently via the in-game editor gui, without adding many new or complex editor buttons, would probably be tricky to achieve since there are many potential aspects to configure here (which players are affected by the discount, which trades are affected, how big is the discount, maybe different groups of players have different discounts, etc.).
I also try to avoid adding new commands for anything related to editing shops.

The only suitable way to identify players I can currently think of are specifying individual players directly via name/uuid, or via a permission node (only suitable for admin shops). I don't see applying discounts based on their history of previous trades as an option currently, since I don't want to track and evaluate all trades (outside the optional and separate best-effort trading history).

The only suitable options I can currently think of to configure this on a per-shopkeeper basis would either be:

  • Maybe be some kind of complex writable-book based editor: Asking the user to write some rules in a book and then parsing those into discounts. I am not sure if something like this would be do-able, nor if this is user-friendly enough.
  • A set of new commands to add, list, edit, remove discounts for individual players or players with a certain permission node. Ideally, I try to avoid those complex command-based interfaces.
commented

if you use interactive commands (like CMI offers) to an npc (citizens) instead of attaching the remotly command to an citicenz directly. you could execute multiple commands depending on permission asssigned to your groups. this could open different shops (i would recomment sign admin shops hidden somewhere else here) that have simliar offers with different prices.

well thats how i would do this if i want different prices for different groups.

  • attached command depending on permission that open different shops remotly.
commented

im in 1.20.2 spigot/paperMC

commented

you cant. the prices are fixed