Module: economy
Overview
This module enables the economy gameplay
.
It allows defining custom currency types
.
A player
can have multiple accounts
.
Each account
holds one type of currency
.
Color Boxes
◉ Make the Admin Shops
and Player Shops
.
You can use this module with Universal Shops
mod.
This mod provides the Admin Shops
and Player Shops
.
It brings the similar gameplay into fabric
like QuickShop
plugin in bukkit
.
◉ Create a /balance
command for players to use.
You can use command_bundle
module.
To create a /balance
command, to wrap the /economy account %player:name% fuji:gold
command.
So the players can query the balance conveniently.
◉ Query the balance
of all currencies
for self.
Issue: /economy balance
◉ Query the balance
of all currencies
for a target player.
Issue: /economy accounts Steve
◉ Query the balance
of the specified currency
for a target player.
Issue: /economy account Steve fuji:gold
◉ Give
, take
, set
or clear
the balance
of specified currency
for a player.
-
/economy give Steve fuji:gold 100
-
/economy take Steve fuji:gold 100
-
/economy set Steve fuji:gold 100
-
/economy clear Steve fuji:gold --confirm true
◉ Transfer the specified balance
of specified currency
from self to another player.
Issue: /economy pay Bob fuji:gold 100
Configurations
The following JSON content is provided for reference only. It must NOT be copied directly into the configuration directory, as it does not represent valid JSON syntax.
- File Name:
config.json
- File Content:
Click to see the default
content...
{
"provider_icon": "minecraft:cherry_sapling",
"balance_top_page_size": 10
/* Define your `custom economy currency` types. */,
"currencies": [
{
"currency_id": "fuji:gold",
"currency_name": "<gold>Fuji Gold",
"currency_icon_item": "minecraft:gold_ingot",
"default_face_balance": 100.0,
"format_value_string": "%.2f",
"format_value_text": "<yellow>$%.2f"
},
{
"currency_id": "fuji:diamond",
"currency_name": "<aqua>Fuji Diamond",
"currency_icon_item": "minecraft:diamond",
"default_face_balance": 0.0,
"format_value_string": "%.2f",
"format_value_text": "<aqua>$%.2f"
}
]
}
- File Name:
economy-data.json
- File Content:
Click to see the default
content...
{
/* Saved `accounts` for each `currency`. */
"currencies": []
}
Commands
-
Command Syntax:
/economy account <OfflineGameProfile player> <CurrencyId currencyId>
-
Document: Get the
player
'saccount
forcurrency ID
. -
Can be executed by console:
true
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/economy accounts <OfflineGameProfile player>
-
Document: List all
accounts
owned by theplayer
. -
Can be executed by console:
true
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/economy balance-top <CurrencyId currencyId>
-
Document: List the top players of specified currency using message.
-
Can be executed by console:
false
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/economy balance-top gui <CurrencyId currencyId>
-
Document: List the top players of specified currency using GUI.
-
Can be executed by console:
false
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/economy balance
-
Document: Query your economy
accounts
. -
Can be executed by console:
false
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/economy clear <OfflineGameProfile player> <CurrencyId currencyId> [Boolean confirm]
-
Document: Clear the
amount
of the player'saccount
forspecified currency
. -
Can be executed by console:
true
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/economy give <OfflineGameProfile player> <CurrencyId currencyId> <double amount>
-
Document: Give
amount
to the player'saccount
forspecified currency
. -
Can be executed by console:
true
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/economy pay <OfflineGameProfile player> <CurrencyId currencyId> <double amount>
-
Document: Pay specified
amount
ofcurrency
to another player's account. -
Can be executed by console:
false
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/economy providers
-
Document: List all installed
economy providers
, and whateconomy currencies
they provided. -
Can be executed by console:
true
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/economy set <OfflineGameProfile player> <CurrencyId currencyId> <double amount>
-
Document: Set the
amount
of the player'saccount
forspecified currency
. -
Can be executed by console:
true
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/economy take <OfflineGameProfile player> <CurrencyId currencyId> <double amount>
-
Document: Take
amount
from the player'saccount
forspecified currency
. -
Can be executed by console:
true
-
Required Level Permission:
4
-
Required String Permission:
null
-
Command Syntax:
/has-currency? <OfflineGameProfile player> <CurrencyId currencyId> <double amount>
-
Document: Has the specified amount of currency?
-
Can be executed by console:
true
-
Required Level Permission:
4
-
Required String Permission:
null
Placeholders
-
Placeholder Name:
fuji:balance
-
Document: Returns the
balance
of the specifiedcurrency
for the player.The syntax is
%fuji:balance <currency-id>%
For example, the
%fuji:balance fuji:gold%
will return thebalance
of thefuji:gold
currency.◉ Escape the placeholder properly.
-
/send-message %player:name% Your balance is %fuji:balance fuji:gold%
-
/run as console send-message %player:name% Your balance is %fuji:balance fuji:gold%
To prevent the placeholder being parsed by the
/run
command.You need to insert a
backslash
character in case2.
before the placeholder. -
Argument Types
- Argument Type Name:
[currency_id]
- Argument Type Class:
[CurrencyId]