CashShop is a Forge mod for Minecraft 1.20.1 made for modpack creators who want to build a configurable in-game item shop using KubeJS.
Create your own shop tabs, sell vanilla or modded items, configure prices and discounts, and use the built-in Copper, Silver, and Gold currency system.
Features
- Configure the entire shop through KubeJS startup scripts.
- Create custom shop tabs with translated names and item icons.
- Sell vanilla and modded items.
- Support for items with custom NBT data.
- Configure how many items are received per purchase.
- Built-in Copper, Silver, and Gold currency system.
- Configure prices using Gold, Silver, and Copper values.
- Add percentage discounts from 0% to 100%.
- Support free shop items.
- Purchase confirmation window for paid items.
- Automatic pagination with 12 products per page.
- Persistent player currency balance.
- Physical Copper, Silver, and Gold Coin items automatically convert into stored currency.
- Optional shop chat messages.
- JEI-aware shop GUI integration.
- Open the shop with the configurable I keybind by default.
KubeJS Example
Put your scripts in:
kubejs/startup_scripts/
Example:
CashshopJSEvents.register(event => {
event.createTab(0, 'tab.cashshop.blocks', 'minecraft:grass_block')
event.createTab(1, 'tab.cashshop.items', 'minecraft:diamond')
// itemId, tabId, count, gold, silver, copper, discount
event.addItem('minecraft:grass_block', 0, 16, 0, 0, 25, 0)
event.addItem('minecraft:diamond', 1, 1, 0, 5, 0, 0)
event.addItem('minecraft:netherite_ingot', 1, 1, 1, 50, 0, 20)
})
NBT Items
Custom NBT items can also be sold:
CashshopJSEvents.register(event => {
event.createTab(0, 'tab.cashshop.special', 'minecraft:enchanted_book')
event.addItemByNBT(
'minecraft:enchanted_book',
'{StoredEnchantments:[{id:"minecraft:sharpness",lvl:5s}]}',
0,
1, 0, 0,
0
)
})
Currency
CashShop uses the following conversion system:
100 Copper = 1 Silver
100 Silver = 1 Gold
1 Gold = 10,000 Copper
The mod also includes physical currency items:
cashshop:copper_item
cashshop:silver_item
cashshop:gold_item
Picking up these coins, or having them detected in your inventory, automatically converts them into your stored CashShop balance.
Discounts
The final argument of addItem and addItemByNBT is the discount percentage.
event.addItem('minecraft:diamond', 0, 1, 0, 10, 0, 25)
This gives the Diamond a 25% discount.
Use 0 for no discount or 100 to make the item free.
Commands
Set your currency:
/shop_set_currency <gold> <silver> <copper>
Add currency:
/shop_add_currency <gold> <silver> <copper>
Disable Chat Messages
Shop messages can be disabled from KubeJS:
CashshopJSEvents.register(event => {
event.disableChatLog()
})
Required Dependencies
- Minecraft Forge 47+
- KubeJS 2001.6.5-build.16+
- ApocalypseLib 1.1.5+
Optional Integrations
CashShop is designed for modpacks that need a simple customizable store without hardcoding the available products into the mod itself. Configure the shop through KubeJS, choose your own economy, and let players purchase the items you decide to offer.