跳到正文

Elements: Economy

作者:Telmarine

A server-side economy for NeoForge 1.21.1 that links your currency to player shops, server shops and an auction house.

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

Minecraft NeoForge Environment Version Type Source

Elements: Economy

Elements: Economy is a server-side economy mod for NeoForge 1.21.1. I couldn’t find an economy setup for 1.21.1 that worked with the mods I already run, so I made my own. It finds whatever currency your server uses and connects it to your shops and auction house, so everything runs on the same money. When you change currency later, everything follows.

In this mod, I have added a Master Control File. Every feature and subcommand has its own on/off switch in config/elements_economy/features.toml. Only those switches need a restart. Every other config file, and the stored data, is reloaded with /economy reload.

It runs on its own or next to Elements: Nexus. Neither one needs the other.

Requires Elements: Vault.

Currency

  • Finds supported currency mods on its own, can use vanilla items such as emeralds when an admin picks them in chat, or falls back to plain digital money.
  • Item values are set in currency_values.toml, so 1 Block of Emerald = 9 Emerald or any ratio you want. They can also be changed in game with /economy currency values.
  • Money is always shown with your currency’s own item names, e.g. “3 Block of Emerald, 5 Emerald”. Digital money can be given any name and symbol.
  • Money is 1:1 between currencies. 1 Emerald is worth 1 digital money.
  • Currency mods where money is an account balance are used for /bal, shops and the auction house too.

The bank and /exchange

With an item currency, players can also keep digital money in a bank.

  • /exchange deposit [amount] [item] puts the currency items you carry into your bank. /exchange withdraw <amount> [item] takes it back out, paid in the fewest items possible.
  • The Tab list shows each item’s in-game name (Gold Coin shows as Gold), never the item ID. Set your own names with names under [exchange] in economy.toml.
  • Players can pay in shops, server shops and the auction house straight from their bank, together with the currency items they carry. Pick which goes first with pay_order (hands_first or bank_first).
  • /bal shows the items you carry plus a “Bank:” line, shown in your currency items.

Shops

  • Player shops: chest and barrel buy/sell shops with a sign display, owner menu, sale alerts, daily limits, per-rank shop limits and an optional creation fee. Create Item Vaults can be linked as stock vaults that restock your shops.
  • Server shops: admin shops that open with /shop or from a linked villager, NPC or block. Players never create or edit them.
  • Shop protection: hoppers, pistons and Create drills, saws and contraptions can’t steal from or break shops.

Auction house

  • Buy-now and bid listings, search, categories, sales tax, a blacklist, and a collection box for your money and items.
  • Staff can make an NPC, a villager or a block open the auction house.

Currency switch-over & migration

  • /economy currency switch shows a preview, then converts balances, shop prices, shop tills, listings and collection boxes to the new currency. A backup is made first.
  • Imports balances from Impactor, Eights Economy, Wano Economy and most currency mods, with a preview before anything is written.

Works with other mods

Bridges for Impactor, OctoEconomy, SDM, Spud’s Shops and Easy NPC. If another mod already handles shops or the auction house, Economy turns its own off so they don’t clash. You can force them back on.

Private trades

Purchases are never announced in chat or Discord. /payments shows your own history.

Storage

JSON (default), YAML, SQLite or MySQL. Copy your data with /economy storage convert <type>, set the type in storage.toml, then run /economy reload. SQLite and MySQL need their driver jar in <server>/elements_economy/drivers (not included): sqlite-jdbc for SQLite, mariadb-java-client for MySQL.

What’s new in 1.0.3

  • Every config change takes effect with /economy reload. Only the on/off switches in features.toml need a restart.
  • /economy reload also reads the stored data files again, and moves to a new storage type once the data has been copied to it.
  • Players can pay from their bank as well as the currency items they carry.
  • The /exchange Tab list shows item names instead of item IDs, and server owners can set their own.

Install

  1. Drop elements_economy-<version>.jar and the Elements: Vault jar into the server’s mods/ folder.
  2. Start the server once to generate config/elements_economy/.
  3. Set your currency: install a currency mod, or answer the setup question in chat.

Commands

Command Permission Default
/bal economy.balance everyone
/bal <player> economy.balance.others OP 2
/pay <player> <amount> / pay toggle economy.pay / economy.pay.toggle everyone
/baltop economy.baltop everyone
/payments economy.history everyone
/exchange deposit / withdraw economy.exchange.deposit / economy.exchange.withdraw everyone
/shop create buy / sell economy.shop.create.buy / economy.shop.create.sell everyone
/shop rename / remove economy.shop.rename / economy.shop.remove everyone
/shop economy.servershop.use everyone
/ah economy.ah.open everyone
/ah link npc / villager / block, /ah unlink economy.ah.link OP 3
/eco give / take / set / reset economy.eco.<action> OP 3
/economy version economy.admin.version OP 2
/economy reload economy.admin.reload OP 3
/economy storage convert <type> economy.admin.storage OP 3
/economy migrate economy.admin.migrate OP 3
/economy currency setup / values / value / remove economy.currency.setup OP 3
/economy currency switch <new currency> economy.currency.switch OP 3

Shop and listing limits can be set per rank with the economy.shop.limit and economy.ah.limit number nodes. The full list is on GitHub.

Config

Files are in config/elements_economy/.

  • features.toml: the Master Control File, one switch per feature and subcommand, plus the overlap guard
  • economy.toml, shops.toml, auction_house.toml, storage.toml
  • currency_values.toml: what each currency item is worth
  • messages.toml: every line players and admins see. After an update, lines you never edited get the new built-in text and lines you edited are kept.

Everything except the features.toml switches is reloaded with /economy reload.

License

Free to use in any modpack. Credit Telmarine. No resale.

常见问题

Elements: Economy 支持哪些 Minecraft 版本?

Elements: Economy 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

Elements: Economy 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

Telmarine 的其他作品

查看全部 →