FancyShop
FancyShop
Create chest shops that trade in physical currencies. Now with 1.8 support!
github.com/DeltaWhy/bukkit-fancyshop
Features
- Create chest shops with a graphical interface.
- Use in-game items as currency.
- Buy and sell any item - enchanted items and books, potions, even items with lore or custom NBT data.
- Buy and sell up to 27 different items in a single shop.
- Shops are protected against damage and against stealing with hoppers.
- Create admin shops that can buy and sell an unlimited number of items.
- Restrict shops to certain regions (depends on Flags).
Commands
/fancyshop: Create and manage shops. (Aliases: /fs, /shop) /fancyshop create - Create a new shop. /fancyshop remove - Remove a shop. /fancyshop rename <name> - Rename a shop. /fancyshop setadmin true - Make a shop an admin shop. /fancyshop setadmin false - Make a shop a normal shop. /fancyshop currency <name> - Add the currently held item as a custom currency.
Configuration
See Configuration and Region Support.
This plugin uses Hidendra's PluginMetrics which sends some anonymized data about your server to mcstats.org. This data includes the plugin and server versions, the server's Java version, the number of online players, the OS version, etc. If you want to opt out you can do so by editing plugins/PluginMetrics/config.yml and changing opt-out: false to true.
Usage
To use a shop, just right-click its chest. You will see a menu of the shop's offers.
To buy an item, click on it while holding currency matching the 'Buy' price. To sell an item, click on the offer while holding that item.
To set up a shop, type '/fancyshop create' and then right-click a chest.
You'll see the 'Manage Shop' menu - to add an offer click on an empty slot while holding the item you want to buy or sell.
To set the price, click that item while holding your desired currency. The wool icon in the bottom right tells you whether you are changing the buy or sell price. Click it to switch. Don't forget to add the item you are selling (or the currency you are buying it with) to your chest. Right-click the chest while sneaking to open it normally.
To remove an offer, click the fire icon in the 'Manage Shop' menu, then click it.
Shops are automatically protected against damage and theft. To break a shop chest, first remove the shop by typing '/fancyshop remove' and right-clicking it. Then you will be able to break the chest normally. These protections can be disabled in config.yml.
Why another shop plugin?
I'm not a fan of economy plugins. While they might make things simpler on large servers, they don't seem very Minecraft-y to me. They add a layer of abstraction that I feel takes away from the survival aspects. However, I like having shops - they give players more choice where to spend their time. If you don't want to spend time mining cobble or building a big farm, you can buy them from someone who does. So I wanted a shop plugin that can use in-game valuables rather than creating an artificial currency.
Why not use GoldIsMoney, Gringotts, etc.?
Because I don't want to inflate any one item (gold, emeralds, diamonds, etc.) by making it the sole currency. On my small whitelisted server, I don't need world protection or other plugins that need Vault compatibility.
Permissions
fancyshop.create: description: Create a shop. default: true fancyshop.create.anywhere: description: Create a shop, bypassing region permissions. default: op fancyshop.rename: description: Change the name of your shop. default: true fancyshop.use: description: Use other people's shops. default: true fancyshop.remove: description: Remove someone else's shop (you can always remove your own) default: op fancyshop.open: description: Open chests for other people's shops. default: op fancyshop.setadmin: description: Create unlimited (admin) shops. default: op fancyshop.currency: description: Add custom currencies. default: op
@DeltaWhy
Ah, spiffin, thanks!
I be a bit confused as to how it works though (to be fair, I haven't gotten a chance to try it out yet and probably won't until I finish my Politics and War paper ;)). What is the "currency book" for, and why do we need the bookdupe plugin?
Is it possible to change the Owner's name in the shop? I'd rather it say "Server Shop" than "croftcw's Shop."
@DeltaWhy
Aha, I see. I was actually already using Shopkeepers but stopped since it broke all the time plus it was too advanced to set up for my players, which is why I went with your plugin instead. But I guess chests will do for now :)
FancyShop v0.4 has been uploaded to BukkitDev and is awaiting approval. This version adds region support, configuration for protections, and custom currencies.
For the next version I'm planning to add UUID support, a command-based way of setting prices and amounts, and support for amounts larger than a stack.
@xpopy
Unfortunately, Bukkit doesn't have the API to allow this. It is possible, see Shopkeepers, but the lack of a proper API means it breaks with every CraftBukkit update and won't work at all with ForgeBukkit, etc. See if that does what you're looking for - if not, you can always do what Mindcrack does and keep a villager around purely for decoration. And of course there's no reason you can't run both plugins at once :)
@PhilosLogos
Added. See the "/fancyshop currency" command. You'll also need a plugin such as BookDupe to prevent players from just copying the currency books.
@FurmanSK
What would be the point of that? An admin shop effectively sells spawned-in items, so that would be equivalent to spawning in currency, and would also make the shop not unlimited since the chest could fill up. Maybe for seeing how often the shop gets used, but that would be better accomplished by hooking into LogBlock and/or Prism. If there's demand for that I'll look at adding it.
I really love this plugin, but you know what would make it even better? Villagers. Make it an option so you can turn a chest into a villager, it would make the shops more lively and friendly to have a villager staring at you instead of chests :)
I would like to agree with Typical_Name. The ability to use custom items as currency would render this plugin nearly perfect. I have a server and I am trying to make it so that players can create their own paper currencies, and the metadata serves counterfeit prevention mechanism as well as a way to differentiate gold-backed and diamond-backed currencies. The ability to use these unique currencies in shops would be God-send. I pray to Jehovah that you consider doing this (but I will bow before your Awesomeness)! :D
Does the admin store not collect the currency and give it to the player who created it? Would be useful it that was the case.
@XxJoelxX14
Try Gringotts, I'm pretty sure it does that. If you want to use items as a Vault currency Gringotts is the way to go.
If this is not to much to ask could you try and add a banking system,so when you put and item in an ender chest it adds it to your money then you do /money to see your balance
@capobase
Good catch! I just uploaded a version 0.3.1 fixing this, BukkitDev has gotten pretty quick on approvals so you should see it in a day or two.
@BleuFlareu
This is also on the todo list. I like the double-click idea, that's nicer than having to specify a slot number in the command. It is basically impossible to handle arbitrary NBT this way (maps in particular are a problem) but for basic data/damage items it would be useful.
@Typical_Name
Hadn't considered this, but it's definitely possible. The reason I don't allow arbitrary currencies right now is because there's no good way to get a name for them, especially if someone accidentally uses something like a damaged tool for the price slot. But with a whitelist the admin can just specify the name. I'll make sure when I implement that that it can handle arbitrary NBT data, and add some way to dump the NBT data for an item in hand.
@all:
I'm undecided on whether I want to support Vault currency. It does not really fit my original goal, which was basically to make a better PhysicalShop that can handle more of the new Minecraft features. On the other hand, I realize a lot of people want it. So consider it a "maybe" but for now I'm focusing on other features.
Hi, there is a bug where you can use left click to create/remove shops so protection plugins are bypassed if you let users remove others shops to make it compatible with factions or raiding servers, so please fix that or add to config, please. Thanks, good plugin bro!
Quickly installed and tested on my server, loving the super easy setup! This is soo much more convenient than our current plugin, typing the item name/codes for everything especially the enchanted items... :I
However, would it be possible to enable players to type what price/item and the quantity they would like for a stocked item (like a double click with an empty hand?). Say for example I want to sell 16 diamond blocks for 1 wither skull , only problem is... I don't have a wither skull to place onto the 16 diamond blocks, to be able to click an item and type "sell wither_head,1" or "sell 397:1,1" and likewise for the buy/trade cost would be awesome and even a way to add $money/currency for shop trades.
Hey ! This plugins is really convenient . But I think you can add money as a buy type , this plugins will be perfect !
This would be MUCH more useful if you could use custom items (items with metadata, including custom names, lore data, and damage values) as currency. This plugin would be approximately perfect if this was rectified.
EDIT: To clarify, the reason that this would be useful is that it would allow admins to create custom items specifically for the purpose of being used as currency, and then use your shop system as a way of having a multiple currency economy. I do have another shop plugin by which I can do this, but your setup is much more convenient as the interface is much easier to understand and you can have multiple items in one shop.
@ArttuJarvinen
It's on my todo list, along with adding support for additional currencies such as lapis dust.
I just enabled the bug tracker on BukkitDev so you can make feature requests or report bugs there if you don't have a GitHub account.
Any way to add a config where it's possible to specify a specific block/item players can use for selling and bying (e.g. only use diamonds as pricing)
FancyShop 0.3 has been uploaded to BukkitDev. This version fixes a critical bug with chest protection plugins and adds unlimited/admin shops with the command /fancyshop setadmin and permission fancyshop.setadmin.
@Sa5mmm
Thanks for the feedback. I don't have admin shops in the current version but I can definitely add that feature. I will also fix the "protected chest" bug ASAP as that's obviously a pretty critical one, and I think I know how to do it without having to handle every protection plugin separately.
I am putting region support on my todo list since I'm sure you're not the only one, but it may be a while before I get to it. In the meantime you could use something like http://dev.bukkit.org/bukkit-plugins/rsp-region-specific-permissions/ to give/revoke the fancyshop.create permission. That one is for WorldGuard but there may be similar things for other region plugins.
Is there a way to create Admin Shops with this? Right now I don't see anyway to do this, but that would be really helpful to some servers.
I also think that a limit on the number of shops each player can have would be useful. Or adding regions where they can and cannot be allowed to create shops.
Oh, I found a big bug. Sort of. I use GriefPrevention so players can't open each others chests without permission, but if I do /fancyshop create on a chest I normally couldn't open then look in the shop's inventory I can steal everything a player has, then just remove the shop and they won't know who stole their goods. When you create a shop the player should be able to open the shop first before it is counted as a successful shop build, or better yet, you should add a sign method of making the shops. So if a player can build a chest on a shop it will count as a successfully created shop. But the sign could be later deleted for it to count as a successful shop. It's just upon first creation of a shop that would be the issue.
@HarveyElder
Still can't replicate it. I can't think of any reason this would be happening - I don't store anything about the inventory in the database, so there's nothing that can get out of sync.
Now that I think about it, it may be caused by several players using a shop at the same time - I'm not sure I properly handle that case. That would explain why neither of us can reproduce it on purpose. I'll look into that when I have some time, and maybe release an update soon.