Shopkeepers

Shopkeepers

2M Downloads

Trading for a command to be executed?

LogGits opened this issue ยท 5 comments

commented

Is there a way to trade for a command?
E.g. Trading 64 diamonds for /eco give {username} 1000

commented

This will be possible with Shopkeepers v2.19.0 (release date TBA). See https://github.com/Shopkeepers/Shopkeepers-Wiki/wiki/Selling-Commands

commented

Nope, you can only setup item trades.

However, you could setup something like this manually with the help of another plugin: You could let your admin shop sell some kind of special item, for example a paper with lore "Right-click to redeem for 1000$". When the player buys this item, he can rigth-click while holding it in his hand in order to redeem it (your separate plugin would have to handle this).
Or your separate plugin could even react to the shopkeeper trade directly, check if the traded item is this special item, and then remove the traded item from the player's inventory (after the trade is handled) and instead given the player 1000$.

But there is nothing built into Shopkeepers to setup something like this.
This request came up a few times already I think. I will keep this ticket open for now, to maybe look into adding something like this again at some point. If I were to add something like this, it would probably work like this:
An admin uses a third party plugin (ex. essentials) to setup a custom item with custom lore. That lore would then have to contain a special phrase like "Execute when traded:" and then the command on the next line.
Another alternative would be to create a separate plugin (if one doesn't exist yet) which does exactly what I pointed out above: Allowing the creating of items, that can be exchanged for server currency when clicked. It would even be possible to let regular player create those items via a special command (upon creation the player's funds would be decreased and he would get an item that can be redeemed for exactly that amount). Or it could work like a cheque, that the funds of the player get decreased only when a player tries to redeem the cheque (which would fail then, if the target player has not enough money currently).

commented

I think the easiest way would be to use a plugin, which allows configuring items to execute command when clicked. There should be various plugins already cabable of this, like for example:

commented

This would be interesting. You mention in your Wiki that a good way to get currency out of the server is by selling protected land. The plugin I use for protected land gives players claim blocks and lets you set how much they start out with, and how much they can earn over time. But theres also a command for giving claim blocks to a player. If you could set up were you could sell an item to players that would give them claim blocks. That would be a really interesting for a server to have.

commented

I vouch for this suggestion, it would open the possibility for many things past just receiving items. If considered would also be nice if you could use an NBT Supported item as an icon for the output of what command is being executed. The player doesn't have to know that a command is being executed.