Compatibility
Minecraft: Java Edition
Platforms
Supported environments
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Creators
Details
Keyconomy
Keyconomy is a datapack-based economy based around the Trial Keys added to 1.21+. Requires Retina to run!
Selling Keys
You can sell keys for money using /trigger SellKeys
, which will sell trial keys for 25 and ominous keys for 100 by default, straight from your inventory.
Withdraw
You can withdraw money from your account by doing /trigger Withdraw set <amount>
, and you'll receive cash items that also get sold back when using the SellKeys
command
MakeShop
Looking at a barrel with items in it (It must be 1 type of item) and using trigger MakeShop set <sell_price>
will turn it into a shop. You can interact with the shop to see details if you're a customer and restock if you're the owner. You can also hit the shop to either purchase from it if you're a customer or destroy it if you're the owner.
CreativeShop
Same deal as MakeShop, except it can't be restocked, has unlimited items, and can only be destroyed or created if you're in creative.
Config
Sell Price
If you want to change how much a key sells for, you can do
data merge storage keyconomy:config {trial_key:25,ominous_key:100}
Max Stock
If you want to change the max amount of stock a shop can hold at once, you can do
data merge storage keyconomy:config {max_stock:5000}
. The default is 5000.
Commands
If you want to disable a certain command, there's a few options. Changing it for everyone is done like this: data modify storage keyconomy:config commands merge value {sell:1b,withdraw:1b,shop:1b}
, where 0b
will disable the command. Per-player, you can enable it for someone by doing tag <player> add key.shop
, and disable it by doing tag <player> add key.no_shop
. If you want to undo this, you can do tag <player> remove key.shop
, etc.
Developers
The scoreboard for player money is stored in a scoreboard called key.money
, and there's a unique player ID stored in key.player.id