HomeJavaModsShopChest
ShopChest
This plugin depends on Vault and an economy plugin that supports Vault (e.g. my plugin JustMoney).

Plugin will not be updated for 1.18.

Last version working up to 1.17 can be found here.

[​IMG]


ShopChest is a very simple to use chest shop plugin. Managing shops is done via command, while using them is done by clicking the chest. A hologram above the chest displays all sorts of information about the shop. What exactly it should show can be customized in the hologram format configuration file, just like a huge number of options can be customized in the normal configuration file. Other features include:

[​IMG]

Usage
By default, a player can buy from a shop by right-clicking the chest, and sell to a shop by left-clicking it. This can be reversed in the config. To buy or sell a stack at once, the player can sneak.
A player can retrieve information about a shop either by using the command /shop info or by clicking the chest with the configured shop-info-item that defaults to a stick.

Commands
The main command name can be customized in the config but will be referred to here as /shop.
The argument <buy-price> refers to the price for which players can buy the item from the shop while <sell-price> is the price for which players can sell their items to the shop.

/shop create <amount> <buy-price> <sell-price> – Create a shop
/shop create <amount> <buy-price> <sell-price> admin – Create an admin shop
/shop remove – Remove a shop
/shop info – Retrieve information about a shop
/shop open – Open a shop
/shop removeall <player> – Remove all of a player's shops
/shop reload – Reload the shops and config
/shop config (set|add|remove) <property> <value> – Set configuration values
/shop update – Check for plugin updates

Permissions

Spoiler: Developer API
Developer API
ShopChest is published on CodeMC's maven repository:

Replace {version} with the respective version
Code (XML):
<repositories>
    <repository>
        <id>codemc-repo </id>
        <url>https://repo.codemc.io/repository/maven-public/ </url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>de.epiceric </groupId>
        <artifactId>ShopChest </artifactId>
        <version>{version} </version>
        <scope>provided </scope>
    </dependency>
</dependencies>
Code (Text):
repositories {
   maven {
       url = "https://repo.codemc.io/repository/maven-public/"
   }
}

dependencies {
   compileOnly 'de.epiceric:ShopChest:{version}'
}
Example Usage
The API is not the most user-friendly and not the most documented, but it should be manageable to implement when necessary.

Have a look at the javadoc
Code (Java):
// Events
@EventHandler (ignoreCancelled = true )
public void onShopBuySell (ShopBuySellEvent event ) {
   Shop shop = event. getShop ( ) ;
    long worldTime = shop. getLocation ( ). getWorld ( ). getTime ( ) ;
    if (worldTime > 20000 || worldTime < 7000 ) {
       event. setCancelled ( true ) ;
       event. getPlayer ( ). sendMessage ( "You can only use a shop between 7am and 8pm." ) ;
    }
}
Code (Java):
// Creating a shop (removing a shop is done similarly)
ShopProduct product = new ShopProduct (itemStack, amount ) ;
Shop shop = new Shop (shopChest, vendor, product, location, buyPrice, sellPrice, shopType ) ;
boolean success = shop. create ( true ) ; // Creates the shop's hologram and item. Passing true so errors are logged in the console.

if (success ) {
    // Adds the shop to the server's shop list
    // Passing true so the shop is added to the database
    // The callback is optional
   shopChest. getShopUtils ( ). addShop (shop, true, new Callback <Void > (shopChest ) {
       @Override
        public void onResult ( Void result ) {
            // Optionally handle the success
        }

       @Override
        public void onError ( Throwable throwable ) {
            // Optionally handle the error here
        }
    } ) ;
}
Code (Java):
// Getting shops
Collection <Shop > shops = shopChest. getShopUtils ( ). getShops ( ) ;
Shop shop = shopChest. getShopUtils ( ). getShop (location ) ;
Code (Java):
// Shop limits
int shopAmount = shopChest. getShopUtils ( ). getShopAmount (player ) ;
int shopLimit = shopChest. getShopUtils ( ). getShopLimit (player ) ;

Spoiler: FAQ
Does this plugin work with 1.13/1.14/1.15/1.16?
  • This version does not yet support 1.13/1.14/1.15/1.16, but you should get a developer build here with the latest feature set, including support for 1.13 - 1.16.1.
AreaShop integration does not work
  • Try to remove any capital letters from the region's name, or wait for the next update.
I cannot buy or sell anything, I am getting You don't have permission to buy/sell something here
  • If you have WorldGuard or PlotSquared installed, you need to allow or set the custom flags use-shop and use-admin-shop which are all denied (or set to owner) by default.
  • You can also grant permission shopchest.external.bypass that allows players to use shops in regions that deny shop use.
I cannot create a shop, I am getting You don't have permission to create a shop here
  • If you have WorldGuard installed and enabled its integration, you need to allow the custom flag create-shop which is denied by default.
  • If you have Towny installed and enabled its integration, a player can create shops only in plots with the configured type.
  • If you have PlotSquared installed, only players with a rank that allows shop creation (can be set per flag create-shop) are allowed to create shops.
  • If you have ASkyBlock, uSkyBlock or IslandWorld installed, a player can create shops only on islands where he/she is member or owner (or as set in the config).
  • If you have GriefPrevention installed, a player can create shops only in regions where he/she is allowed to open chests.
  • If you don't have any of them installed, you probably have a chest protection plugin installed (like Lockette or LWC) which denies players to open the chest. When players cannot open a chest, ShopChest will not allow them to create a shop there.
  • If you enable the debug log in the config (and reload or restart the server), you can read the reason why a player is not allowed in the debug.txt file.
  • You can also grant permission shopchest.create.protected that allows players to create shops on every type of protected chest and in regions or plots that deny shop creation.
I am getting Could not find translation "..." in selected language file. Using default translation ("...") in the console
  • This means that the selected language file is not up to date and doesn't contain the localization of a specific message, item name or similar.
  • If you haven't changed anything in the selected language file, you can remove it so ShopChest creates a new and updated one.
  • If you have changed some entries in that file, you can either back up the changed entries, delete the file, let a new one be created and paste the entries back in, or add the missing values in the right format to the language file.

[​IMG]
View the source on GitHub
Get development builds

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

ShopChest is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11 and newer. Downloaded 218,151 times (via Spigot). Download it and open it directly in the game.

Explore more