Numericalstorage Definition
Defines a configurable numerical storage
Felder
| Feld | Typ | Standard | Beschreibung | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
prefix | String | — | Prefix used in messages. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
artifact | Ref<PlayerNumericalStorageArtifactEntry> | — | Artifact storing player data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
interestEnabled | Boolean | false | Enable interest system based on real time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
interestRate | Double | 0.0 | Interest rate in percentage (e.g. 2.0 for 2%). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
interestMessage | String | <green>You received <amount> interest! New balance: <new_balance> | Message when interest is applied. Placeholders: <amount> <new_balance> <rate> <prefix> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
interestRates | List<InterestRatePermission> | empty | List of permission based interest rates. Each entry defines a permission and a specific rate.
|
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
permission | String | — | Permission node required for this rate. |
rate | Double | 0.0 | Interest rate in percentage for this permission. |
levelsList<BankLevel>emptyBankLevel (10)
| Feld | Typ | Standard | Beschreibung | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
limit | Double | 0.0 | Maximum balance/xp allowed. | ||||||||||||||||||||||||||||||||
depositErrorMessage | String | — | Message when deposit/xp exceeds limit. Placeholders: <limit> <amount> <prefix> | ||||||||||||||||||||||||||||||||
depositMessage | String | — | Message when deposit/xp add succeeds. Placeholders: <limit> <amount> <new_balance> <prefix> | ||||||||||||||||||||||||||||||||
levelUpMessage | String | — | Status message when this level is reached. | ||||||||||||||||||||||||||||||||
interestRate | Double? | — | Interest rate specific to this level (e.g. 1.5 for 1.5%). If null, the global rate is used. | ||||||||||||||||||||||||||||||||
interestCap | Double | 0.0 | Maximum interest gain per cycle (Cron) for this level. Set to 0 for no limit. | ||||||||||||||||||||||||||||||||
criteria | List<LevelCriteria> | empty | Criteria required to unlock this level (all must be met).
|
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
mode | CriteriaMode | PLACEHOLDER | Mode of criteria: PLACEHOLDER or FACTWerte:PLACEHOLDERFACT |
placeholder | String | — | Placeholder that returns a numeric value (e.g. %player_level%, %vault_eco_balance%). Used when mode is PLACEHOLDER. |
fact | Ref<ReadableFactEntry> | — | Fact entry to read the criteria value from. Used when mode is FACT. |
requiredValue | Double | 0.0 | Required value to meet the criteria. |
comparison | ComparisonType | GREATER_THAN_OR_EQUALS | Comparison type for the criteria check.Werte:EQUALSNOT_EQUALSGREATER_THANGREATER_THAN_OR_EQUALSLESS_THANLESS_THAN_OR_EQUALS |
deductOnMet | Boolean | false | If true and mode is PLACEHOLDER, deduct the required value from the source when criteria is met. |
deductCommand | String | — | Command to execute to deduct the required value (e.g. 'eco take {player} {amount}'). Placeholder: {amount}, {player}. |
levelUpTriggersList<Ref<TriggerableEntry>>emptywithdrawMessageStringwithdrawErrorMessageStringmenuNumericalStorageMenuConfigNumericalStorageMenuConfig (31)
| Feld | Typ | Standard | Beschreibung | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
title | String | Storage | Title of the menu. | ||||||||||||||||||||||||||||||||||||
rows | Int | 3 | Number of rows in the menu. | ||||||||||||||||||||||||||||||||||||
fillEnabled | Boolean | true | Background item to fill empty slots. | ||||||||||||||||||||||||||||||||||||
fill | ItemTemplate | — | Item used to fill empty slots.
|
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
item | Item | — | Item used when rendering the item |
lore | List<String> | empty | Lore displayed on the itemPlatzhalterFarbenMehrzeilig |
transactionButtonsList<TransactionButtonConfig>emptyTransactionButtonConfig (7)
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
type | TransactionType | DEPOSIT | Type of transaction: DEPOSIT, WITHDRAW, or TRANSFER.Werte:DEPOSITWITHDRAWTRANSFER |
amountType | AmountType | FIXED | Type of amount: FIXED, PERCENTAGE, CUSTOM, or ALL.Werte:FIXEDPERCENTAGECUSTOMALL |
amount | Double | 0.0 | Amount for FIXED (value) or PERCENTAGE (0-100). Ignored for CUSTOM and ALL. |
template | ItemTemplate | — | Item to display. |
slots | List<Int> | — | Slot in the inventory. |
label | String | — | Optional label override for the button. If empty, the default label from the menu config is used. |
transferTarget | String | — | (TRANSFER only) Target definition ID. The balance is transferred from this storage to the target. |
optionalButtonsList<OptionalButtonConfig>emptyOptionalButtonConfig (2)
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
template | ItemTemplate | — | Item to display. |
slots | List<Int> | — | Inventory slots (0 = top left, 9 per row). Slots outside the menu size are ignored. |
customAmountDialogDialogConfigDialogConfig (7)
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
title | String | Enter Amount | Title of the dialog for custom amount input. |
inputLabel | String | Amount | Label for the input field. |
inputPlaceholder | String | 100 | Placeholder text for the input field. |
inputWidth | Int | 200 | Width of the input field. |
maxLength | Int | 16 | Maximum length of the input field. |
submitButton | String | Submit | Text for the submit button. |
invalidInputMessage | String | <red>Invalid amount!</red> | Message shown on invalid input. |
levelButtonLevelButtonConfigLevelButtonConfig (3)
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
availableTemplate | ItemTemplate | — | Item to display when level up is available. Placeholders: {cost}, {level} |
maxLevelTemplate | ItemTemplate | — | Item to display when max level is reached. |
slots | List<Int> | — | Slot in the inventory. |
closeButtonCloseButtonConfigCloseButtonConfig (2)
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
template | ItemTemplate | — | Item to display for the close button. |
slots | List<Int> | — | Slot in the inventory. |
depositLabelString<green>DepositdepositPercentLabelString<green>Deposit %depositCustomLabelString<green>Deposit CustomdepositAllLabelString<green>Deposit AlldepositSubmenuLabelString<green>Deposit More...withdrawLabelString<red>WithdrawwithdrawPercentLabelString<red>Withdraw %withdrawCustomLabelString<red>Withdraw CustomwithdrawAllLabelString<red>Withdraw AllwithdrawSubmenuLabelString<red>Withdraw More...transferLabelString<aqua>TransfertransferPercentLabelString<aqua>Transfer %transferAllLabelString<aqua>Transfer AlltransferInsufficientMessageString<red>Insufficient balance in source for transfer.transferCapacityMessageString<red>Target storage has insufficient capacity.transferSuccessMessageString<aqua>Transferred <amount>! New source balance: <new_balance>, target: <target_balance>transferTargetNotFoundMessageString<red>Target storage not found.transferTargetUnavailableMessageString<red>Target storage is not available.maxLevelMessageString<red>Already at max level.criteriaNotMetMessageString<red>You don't meet the requirements to level up.notEnoughFundsMessageString<red>Not enough funds to upgrade. Cost: <cost>subMenusMap<String, SubMenuConfig>emptySubMenuConfig (8)
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
title | String | Options | Title of the sub-menu. |
rows | Int | 3 | Number of rows in the sub-menu. |
transactionButtons | List<TransactionButtonConfig> | empty | List of transaction buttons in this sub-menu. |
optionalButtons | List<OptionalButtonConfig> | empty | List of optional buttons in this sub-menu. |
backButton | ItemTemplate | — | Configuration for the back/return button. |
backButtonSlots | List<Int> | — | Slots for the back button. |
closeButton | CloseButtonConfig | — | Configuration for the close button in the sub-menu. |
fill | ItemTemplate | — | Background item to fill empty slots. |
interestCronCronExpressiontransactionTransactionConfigTransactionConfig (12)
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
transactionMode | TransactionMode | INTERNAL | How the external economy is integrated: INTERNAL (commands + placeholder) or VAULT (direct API).Werte:INTERNALVAULT |
amountPlaceholder | String | — | (INTERNAL mode) Placeholder to read the source balance (e.g. %vault_eco_balance%). Ignored in VAULT mode. |
addSuccessMessage | String | <green>Successfully added <amount>! New balance: <new_balance> | Message when adding to storage succeeds. Placeholders: <amount>, <new_balance>, <limit>, <prefix> |
addErrorMessage | String | <red>Cannot add <amount>. Would exceed limit of <limit>. | Message when adding exceeds limit. Placeholders: <amount>, <balance>, <limit>, <prefix> |
removeSuccessMessage | String | <green>Successfully removed <amount>! New balance: <new_balance> | Message when removing from storage succeeds. Placeholders: <amount>, <new_balance>, <limit>, <prefix> |
removeErrorMessage | String | <red>Cannot remove <amount>. Insufficient balance (<balance>). | Message when removing exceeds available balance. Placeholders: <amount>, <balance>, <limit>, <prefix> |
addCommand | String | — | (INTERNAL mode) Command executed before the persistent DEPOSIT mutation. Placeholders: {amount}, {player}. Ignored in VAULT mode. |
removeCommand | String | — | (INTERNAL mode) Command executed before the persistent WITHDRAW mutation. Placeholders: {amount}, {player}. Ignored in VAULT mode. |
noFundsMessage | String | <red>No funds available. | Message when no funds available for transaction. Placeholders: <prefix> |
invalidAmountMessage | String | <red>Invalid amount. | Message when amount is invalid. Placeholders: <prefix> |
vaultInsufficientMessage | String | <red>Insufficient funds in your economy balance. | (VAULT mode) Message when Vault deposit fails (e.g. insufficient economy funds). Placeholders: <amount>, <prefix> |
vaultUnavailableMessage | String | <red>Economy system is not available. | (VAULT mode) Message when Vault integration is unavailable. Placeholders: <prefix> |
profileModeBooleanfalseadminMessagesAdminCommandMessagesAdminCommandMessages (8)
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
resetMessage | String | <red><bold>Typewriter »<reset><white> Numerical storage reset for <player>. | Reply to /typewriter ns reset. Placeholders: <player>, <storage>, <prefix>PlatzhalterFarben |
levelSetMessage | String | <red><bold>Typewriter »<reset><white> Set numerical storage level to <level> for <player>. | Reply to /typewriter ns level. Placeholders: <player>, <level>, <storage>, <prefix>PlatzhalterFarben |
addMessage | String | <red><bold>Typewriter »<reset><white> Added <amount> to <player>. | Reply to /typewriter ns add. Placeholders: <player>, <amount>, <storage>, <prefix>PlatzhalterFarben |
removeMessage | String | <red><bold>Typewriter »<reset><white> Removed <amount> from <player>. | Reply to /typewriter ns remove. Placeholders: <player>, <amount>, <storage>, <prefix>PlatzhalterFarben |
noMenuMessage | String | <red><bold>Typewriter »<reset> <red>No menu entry found for storage '<storage>'. Create a 'numericalstorage_open_menu' entry in a Typewriter page. | Reply to /typewriter ns open when no Open Numerical Storage Menu entry is linked to the definition. Placeholders: <storage>, <prefix>PlatzhalterFarben |
invalidAmountMessage | String | <red><bold>Typewriter »<reset> <red>Invalid amount '<amount>'. Use a positive number. | Reply to /typewriter ns add and remove when the amount is not a positive number. Placeholders: <amount> (the value typed), <player>, <storage>, <prefix>PlatzhalterFarben |
noArtifactMessage | String | <red><bold>Typewriter »<reset> <red>Storage '<storage>' has no artifact linked. Link a 'player_numericalstorage_artifact' entry to it. | Reply to /typewriter ns add, remove, level and reset when no artifact is linked to the definition. Placeholders: <player>, <storage>, <prefix>PlatzhalterFarben |
noActiveProfileMessage | String | <red><bold>Typewriter »<reset> <red><player> has no active profile. | Reply to /typewriter ns add, remove, level and reset, and to a menu action, when the definition is in profile mode and the player has no active MMOProfiles profile (profile selection, or a profile still loading). Nothing is written. Placeholders: <player>, <storage>, <prefix>PlatzhalterFarben |
Gemeinsame TypeWriter-Felder (displayName)
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
displayName | String | — | Display name shown to players. |
How to use it
One definition is one store. Use its entry id in placeholders, in /typewriter ns commands and as transferTarget.
- Levels.
levelsis a list: the first line is level 1.limitis the maximum balance of that level. With no levels, the capacity is unlimited. A level can override the interest withinterestRateandinterestCap(0means no cap), and runslevelUpTriggerswhen reached. - Upgrading. The upgrade button moves a player to the next level. If the next level has
criteria, each one compares a placeholder or a fact (mode) withrequiredValueusingcomparison. WithdeductOnMetand adeductCommand({player},{amount}), the value is taken from a source such as a Vault balance. If the next level has nocriteria, the player pays thelimitof their current level from the stored balance. - Interest. Turn on
interestEnabled, setinterestRate(percent) andinterestCron. The rate is, in order, the first permission ofinterestRatesthe player has, then the levelinterestRate, then the global rate. Interest is calculated when a player joins, for the cycles they missed (at most 100), and never goes above the capacity. - Transactions. In
VAULTmode, deposits and withdrawals use your Vault economy and ignoreamountPlaceholder,addCommandandremoveCommand. InINTERNALmode,amountPlaceholdergives the source balance (for example a%vault_eco_balance%placeholder),addCommandruns from the console to take the money on a deposit, andremoveCommandruns to give it back on a withdrawal. Both commands run before the storage is changed and must succeed. They accept{player}and{amount}. - Messages. The messages are MiniMessage and accept
<amount>,<new_balance>,<balance>,<limit>and<prefix>where the field help lists them. - Profile mode.
profileModestores one balance per MMOProfiles profile. MMOProfiles is optional: without it, the balance is the player's (key = their UUID). With MMOProfiles and no active profile (profile selection, after/mmoprofiles quit), the balance shown is 0 and writes are refused withnoActiveProfileMessage(inadminMessages). Interest is settled when a profile is selected. - Menu.
menuholds the title, the number of rows, the transaction buttons and the sub-menus. Where the items sit in the inventory is decided by thelayoutPoolof the Open Menu action.optionalButtons(inmenuand in each sub-menu) are display-only items drawn at theirslots; a click on them does nothing. They replace whatever the layout or the other buttons put in the same slot, and slots outside the menu size are ignored.