-
Notifications
You must be signed in to change notification settings - Fork 6
features loans
Allows players to borrow money from the server and repay it in installments. Installment collection runs automatically via the scheduler; continued default marks the loan as DEFAULTED and applies penalty effects.
-
/loan(alias/prestamo) — Opens the loans GUI menu (LoanMenuService) -
/vault loan— Equivalent access from the main command -
/vault cancel— Cancels an in-progress chat flow
Permission: vault.loan (default true). Global config loans.enabled: false disables the entire module without needing permissions.
loans:
enabled: true
max_active_per_player: 1 # simultaneous loans per player
min_amount: 1
max_amount: 100000
min_installment: 1
min_installment_by_amount: # increasing minimum installment by amount
1000: 50
5000: 250
max_installments: 60
default_interval_hours: 24 # hours between installments (default value)
charge_check_seconds: 60 # charge scheduler frequency
max_missed_payments: 3 # missed payments → DEFAULTED
defaulted_effects:
enabled: true
refresh_seconds: 5 # re-applies effects every X seconds
duration_seconds: 8
effects:
- "SLOW:1" # slowness (EFFECT_NAME:LEVEL 1-based)
- "SLOW_DIGGING:1" # mining fatigueLegacy formats are also accepted: loans.installment_minimum_tiers (map list) and loans.minimum_installment_by_amount (nested section). minimumInstallmentFor() evaluates all sources and picks the maximum.
LoanService.openRequestFlow() starts a chat conversation with ConversationState states (LoanService.java:786–796):
ASK_AMOUNT → ASK_TYPE ── [total] → ASK_TOTAL_DELAY_HOURS → createLoan
│
└─ [installments] → ASK_INSTALLMENTS_MODE ── [count] → ASK_INSTALLMENTS
└─ [amount] → ASK_INSTALLMENT_AMOUNT
↓
ASK_INTERVAL_HOURS → ASK_FIRST_DELAY_HOURS → createLoan
- Total mode — A single future payment (1 installment). Player only enters the delay in hours.
- Installments by count mode — Specifies how many installments; installment = amount / N.
- Installments by $ mode — Specifies amount per installment; N = ceil(amount / installment).
If interval_hours ≤ 0 or first_delay_hours ≤ 0, the config default value is used.
Every charge_check_seconds a runTaskTimerAsynchronously scans active loans and synchronizes back to the main thread to load balances (LoanService.java:305–371):
- If
nextChargeAtMs ≤ nowattempts to chargeinstallmentAmount(or whatever remains) - If balance exists: charges →
installmentsLeft--→ advancesnextChargeAtMs += intervalMs - If NO balance:
missedPayments++ - When
max_missed_paymentsis reached:status = DEFAULTED
LoanStatus: ACTIVE → PAID or DEFAULTED
| Event | TxType |
|---|---|
| Initial disbursement | LOAN_DISBURSE |
| Manual / installment payment |
LOAN_REPAY (note that charging uses normal economy.withdraw) |
| Loan defaulted | LOAN_DEFAULT |
| Collateral seized | LOAN_COLLATERAL_SEIZED |
When paying manually (/vault loan → Pay) the player can enter the amount or all / todo to settle the full debt.
If defaulted_effects.enabled: true and the loan is in DEFAULTED status, effects are RE-applied to the online player every refresh_seconds. Legacy name mapping:
| Legacy alias | Modern Minecraft name |
|---|---|
SLOWNESS |
slowness |
FATIGUE |
mining_fatigue |
FAST_DIGGING |
haste |
INCREASE_DAMAGE |
strength |
HEAL/HARM
|
instant_health / instant_damage
|
| etc. | Resolved by legacyEffectKey()
|
Config effect levels are 1-based; internally 1 is subtracted to convert to Bukkit's 0-based amplifier.
Vault Economy v2.1.0 · Compatible with Spigot 1.8.8 – 1.21.x
📦 Modrinth ·
💬 Discord ·
Java 17 (legacy) · Java 21 (modern)
Documentation generated on 2026-09-03 · Vault Project Team
- 🏠 Home
- 🚀 First Install
- 🧑🏫 Getting Started
- ❓ Basic FAQ
- 📋 Complete Command List
- 🛡️ Complete Permission List
- ⚙️ config.yml Reference
- 🌐 Supported Languages
- 🆕 Modrinth Updates
- 💰 Player-to-Player Payments
- 🏦 Bank System
- 💵 Physical Notes
- 💸 Loans
- 📜 Transaction History
- 📊 Top Players
- ⏸️ Offline Payments
- 💳 Charges / Payment Requests
- 🔔 Discord Webhook
- 🛠️ Installation Errors
- 🚫 Players Can't Pay
- 🧨 Balances Wiped on Restart
- 📉 Bank Doesn't Pay Interest
- 🧾 Invalid / Expired Notes
- 🩺 Complete Step-by-Step Troubleshooting
- Java API
- 📜 Skript
- 🧰 Contribute · Dual Maven Build