HOW TO: Limit Access to Currencies
The limitCurrency feature in TheNewEconomy allows server administrators to restrict specific actions for players based on permissions tied to individual currencies. This is useful for providing fine-grained control over who can interact with particular currencies and in what ways.
Configuration
To enable this feature, set Core.LimitCurrency
to true
in your config.yml
:
Once enabled, permissions checks will be applied for various currency-related actions.
Permissions
Each action requires a permission in the format:
tne.money.[action].[currency]
Replace [action]
with the action being restricted and [currency]
with the currency identifier. For example:
tne.money.balance.usd
– Allows checking the balance for the USD currency.tne.money.deposit.euro
– Allows depositing funds in the Euro currency.
Supported Actions
Here is a list of actions that can be restricted using limitCurrency
:
balance
Checking a balance
tne.money.balance.usd
deposit
Depositing funds
tne.money.deposit.euro
withdraw
Withdrawing funds
tne.money.withdraw.usd
convert
Converting between currencies
tne.money.convert.to.usd
pay
Paying other players
tne.money.pay.usd
request
Requesting funds from players
tne.money.request.usd
top
Viewing the leaderboard for balances
tne.money.top.usd
set
Setting player balances
tne.money.set.usd
take
Taking funds from players
tne.money.take.usd
note
Creating currency notes
tne.money.note.usd
How It Works
When limitCurrency
is enabled, TheNewEconomy checks the permissions before performing any action. If a player lacks the required permission, they will receive a customizable message indicating the action is blocked.
Example code for permission checks from MoneyCommand.java
:
Customizing Messages
Blocked action messages can be customized in messages.yml
under Messages.Account.BlockedAction
. Example:
Summary
The limitCurrency
feature provides server administrators with powerful tools to control access to specific currencies and actions. This ensures that currency-related functionality aligns with your server's rules and permissions system.
Last updated