Coins 1.96

Let your server have custom currency and shops

  1. JasperJH
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    What does it do:
    • It makes a custom currency with MySQL

    Config file:
    • Set the server address and more information about the MySQL database!
    • Set the prefix of all messages that the plugin will send!
    • Set the messages the plugin sends to the player
    • If you want multiple servers to have the same coins table set the server name to the same
    • Customize the command used for the plugin

    - Placeholders(Not every message supports these placeholders):
    %COINS% will show the amount of coins in that message,
    %TARGET% will show the target player in that message,
    %PLAYER% will show who did it in the message
    - Most messages speak for them self but some messages you might not understand what they do.
    [*] addCoins, removeCoins and setCoins are sent to the player when he or she edits their own amount of money. This message supports %COINS%.
    [*] addTargetCoins, removeTargetCoins, setTargetCoins is the message that will be sent to the player when their amount is changed by someone else. This message supports %COINS% and %PLAYER%.
    [*] addPlayerCoins, removePlayerCoins, setPlayerCoins are sent to the executor of the command when changing someone else's amount of money. This message supports %COINS% and %TARGET%
    [*] loadingerror are sent to the executor of the command when there is an invalid UUID or name

    Permission:
    • Coins.Commands: The permission to use the /coins command

    Commands:
    • /Coins: Shows your balance no permission needed!
    • /Coins <UUID\NAME>: To see the amount of coins a player has
    • /Coins add <PlayerName> <amount> | /coins add <amount>: will add the amount you specify to your balance or that from the specified player
    • /Coins remove <PlayerName> <amount> | /coins remove <amount>: will remove the amount you specify from your balance or that from the specified player
    • /Coins set <PlayerName> <amount> | /coins set <amount>: Will set the amount of coins you have or that from the specified player

    API:
    • Just type Coins. and than:
    • getCoins(Player p) will return the amount of coins a player has
    • setCoins(Player p, Integer Amount) will set the amount of coins
    • addCoins(Player p, Integer coins, boolean notify) will add the amount of coins and the player will be notified with an actionbar if notify equals true
    • removeCoins(Player p, Integer coins, boolean notify) will remove the amount of coins and the player will be notified with an actionbar if notify equals true
    • getOfflineCoins(String data) gets the coins from a offline player, data can be an UUID or a player name

    How to use the Shop GUI:
    • You can create a shop with InventoryManager.createShopInventory(ShopInventory)
    • When creating a new shop gui it will add 3 basic methods: getSuccessfulPurchaseMessage(String defaultmessage), getNotEnoughMoneyMessage(String defaultmessage) and getNoPermissionMessage(String defaultmessage), This are the messages which get send when an action happens, the all explain them selfs when. defaultmessage is the message I set by default. If you return null it will not send a message to the player.
    • You can also override the onClick(Player p, DisplayItem item, ClickType click) method. If you override this it won't act like a shop. This method gets called when you click somewhere when the shop is open, it doesn't check if the DisplayItem is null.
    • You can add and remove custom display items and set what the will add to the inventory when bought.
    Examples:
    Code (Text):
    ShopInventory inventory = InventoryManager.createShopInventory(new ShopInventory(ChatColor.AQUA + "Shop", 9) {


                @Override
                public String getSuccessfulPurchaseMessage(String defaultmessage) {
                    return defaultmessage;
                }

                @Override
                public String getNotEnoughMoneyMessage(String defaultmessage) {
                    return  ChatColor.RED + "You don't have enough money";
                }

                @Override
                public String getNoPermissionMessage(String defaultmessage) {
                    return null;
                }
            });
    inventory.addItem(displayitem);
    inventory.open(player);
    Code (Text):
    new DisplayItem(ItemStack item, int price, int slot, BuyItem buyitem);
    new DisplayItem(ItemStack item, String permission, int slot, BuyItem buyitem);
    new DisplayItem(ItemStack item, int price, String permission, int slot, BuyItem buyitem);
    new DisplayItem(Material material, byte data, int price, int slot, BuyItem buyitem);
    new DisplayItem(Material material, byte data, String permission, int slot, BuyItem buyitem);
    new DisplayItem(Material material, byte data, int price, String permission, int slot, BuyItem buyitem);
     
    Code (Text):
    new BuyItem(Material material, int amount);
    new BuyItem(Material material, int amount, byte data);
    new BuyItem(ItemStack item);
    Code (Text):
    setDisplayName(String name): set the item displayname.
    setAmount(int amount): set the item amount.
    setUnbreakable(boolean unbreakable): set if the item is unbreakable.
    setItemMeta(ItemMeta meta): set the itemmeta.
    addItemFlag(ItemFlag... flags): add ItemFlags.
    removeItemFlag(ItemFlag... flags): remove ItemFlags.
    setLore(String... lore)/setLore(ArrayList<String> lore): set the lore.
    addLore(String... lore): add lore.
    setColor(Color color): Set color, only for Leather armor.
    setColor(int red, int green, int blue):Set color, only for Leather armor.
    addEnchantment(Enchantment ench, int level): Add enchantments, these can be any enchantment at any level.
    setGlow(boolean enchanted): set if the item is glowing.
     
    Code (Text):
    InventoryManager.createShopInventory(new ShopInventory(ChatColor.AQUA + "Shop", 9) {

                @Override
                public void onClick(Player p, DisplayItem item, ClickType click) {
       
                if (item == null)
                    return;
                p.sendMessage(ChatColor.GRAY + "You clicked a shop item :)");
                }

                @Override
                public String getSuccessfulPurchaseMessage(String defaultmessage) {
                    return defaultmessage;
                }

                @Override
                public String getNotEnoughMoneyMessage(String defaultmessage) {
                    return defaultmessage;
                }

                @Override
                public String getNoPermissionMessage(String defaultmessage) {
                    return defaultmessage;
                }
            });


    What things should I add next?
    if you find any bugs tell them and I will fix them ASAP!

Recent Reviews

  1. sklm
    sklm
    5/5,
    Version: 1.96
    代码精短。
    兼容性高。(可以通过桥,兼容海绵!)
    如果添加消耗硬币获得奖励的指令就好了!!

    新手,完全不会使用这个。

    哪怕有一个简单的消耗硬币的指令。也是很不错的!
  2. Yom
    Yom
    5/5,
    Version: 1.96
    Is good plagggan. But could be better if it work. Sorry plaggooon is goo = :D how many times do I ned to put in server?
  3. MoMOAH
    MoMOAH
    4/5,
    Version: 1.96
    :) Awesome plugins, if it can add more functions will be great !! keep on! ***** 5 Stars
  4. SunnyLo
    SunnyLo
    5/5,
    Version: 1.96
    Great plugin, I think it is the only plugin for custom currency, API, and custom shop. But is there any support discord so that we can ask questions, also, can I use this plugin over 1.10?
    1. JasperJH
      Author's Response
      Thanks for the review. I don't really think I need to add a discord for the plugin, since you can easily contact me on here. However I might still create one just to make it easier to get in contact with me.

      The plugin should work fine on version 1.10 and above. I haven't listed them as working versions since I haven't tested them myself.
  5. LucaDZN
    LucaDZN
    5/5,
    Version: 1.96
    I love this plugin. Thanks to this plugin I managed to plug all plugins without bugs. Really a good job Jasper!
    1. JasperJH
      Author's Response
      Thanks for the review!
  6. Alperen
    Alperen
    5/5,
    Version: 1.96
    Featherboard %COINS% Don't working .
    1. JasperJH
      Author's Response
      Thanks for the review. Featherboard doesn't support this coins plugin, so that is why the %COINS% placeholder isn't working.
  7. drood
    drood
    3/5,
    Version: 1.96
    Good plugin however players coins can go below 0 when they spend them :/


    This is to reach 100 Characters
    1. JasperJH
      Author's Response
      Thanks for the review. It shouldn't be possible to go below the 0 coins. However, haven't had the code for this project open in a long time and will look into it!
  8. Blood
    Blood
    4/5,
    Version: 1.96
    Nice plugin, but could you please add command (or permission) not to remove coins (display error message) if player doesn't have them (Ex. I execute /Coins remove Nick 500 and Nick has 200, so it will be good if customizable error message will display). Thank you!
    1. JasperJH
      Author's Response
      Thanks for the review!

      I believe the plugin won't go below zero. So there isn't anything going wrong when the player doesn't have enough coins!

      But I might add it later if I have a working pc again!
  9. Ilario42
    Ilario42
    5/5,
    Version: 1.96
    good plugin, please enable variables for featherboard (mwdw) please .....

    Good work

    the plugin is fantastic
    1. JasperJH
      Author's Response
      Thanks for the review!

      I don't own a version of Featherboard so I'm unable to hook into that plugin and add my own placeholders.
  10. Jonathan10
    Jonathan10
    4/5,
    Version: 1.96
    the plugin is not updated with mysql :s

    I on minecraft: 5 coins
    mysql: 0 coins

    Can you please remove the bug ?

    Thanks
    1. JasperJH
      Author's Response
      That is because the MySQL table will only update when you leave!