Keyconomy
Keyconomy is a Minecraft economy system based on a datapack and centered around the use of trial keys introduced in version 1.21 and later. Requires the Retina datapack to function!
Selling Keys
You can easily exchange keys for in-game currency using the /trigger SellKeys command. By default, regular trial keys are worth 25 coins, while ominous keys are valued at 100 coins. Funds are automatically deducted from your inventory storage.
Withdrawing Funds
To withdraw money from your account, use the command /trigger Withdraw set <amount>. You'll receive special cash items that can also be converted back into coins when using the key selling command.
Creating Shops
Aim at a pre-filled barrel (it must contain only one item type) and execute trigger MakeShop set <sell_price> to convert it into a trading point. When interacting with the shop, customers can view item information, while owners can restock supplies. Hitting the shop allows customers to make purchases, and the owner to destroy their trading point.
Creative Shop
Similar to a regular shop, but with some differences: it has unlimited item supply, restocking is impossible. Creation and destruction are only available to players in creative mode.
Configuration
Selling Prices
To change key values, execute:
data merge storage keyconomy:config {trial_key:25,ominous_key:100}
Maximum Stock
To modify the item storage limit in shops, use:
data merge storage keyconomy:config {max_stock:5000}
Default value is 5000 units.
Command Management
To disable specific commands for all players, execute:
data modify storage keyconomy:config commands merge value {sell:1b,withdraw:1b,shop:1b}
where 0b deactivates the command. For individual settings, manage access through player tags: tag <player> add key.shop permits, tag <player> add key.no_shop restricts shop commands. To remove limitations, delete the corresponding tags.
For Developers
Player balances are stored in the scoreboard key.money, and each player's unique identifier is located in the key.player.id variable.