Skip to main content

Economy

TeleporterPro integrates with Vault to charge players for teleportation. The economy system is optional and completely independent of the teleport logic โ€” disabling it has no other side effects.

Requirementsโ€‹

  • Vault plugin installed
  • A Vault-compatible economy plugin (EssentialsX Economy, CMI, PlayerPoints, etc.)
  • economy.enabled: true in config.yml

Enabling Economyโ€‹

economy:
enabled: true

tpa:
cost: 100.0

tpahere:
cost: 100.0

home:
cost: 50.0

warp:
default-cost: 0.0 # 0 = free by default; individual warps can override this

Anti-Exploit: Check Now, Charge Laterโ€‹

This is the most important design detail. Money is handled in two stages:

  1. At send / command time โ€” the player's balance is checked. If they can't afford it, the action is blocked immediately with a clear message. If they can, they are shown a "will be charged X" notice.
  2. After warmup completes โ€” the balance is checked again and the charge is applied. If the player spent their money in the meantime, the teleport is cancelled with no charge to either side.

This prevents the classic exploit of sending a request, draining your wallet, and getting a "free" teleport after the other player accepts.

Payment Confirmation GUIโ€‹

When economy is enabled and the cost is greater than zero, a Payment Confirmation GUI appears before a TPA request is sent:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ [G] [G] [G] [ยท] [H] [ยท] [R] [R] [R] โ”‚
โ”‚ [G] [G] [G] [ยท] [ยท] [R] [R] [R] โ”‚
โ”‚ [G] [G] [G] [ยท] [ยท] [ยท] [R] [R] [R] โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
G = Confirm H = Target head R = Cancel

The center head shows:

  • Target player's name
  • Request direction (You โ†’ Target or Target โ†’ You)
  • Cost (shown as "Free" when cost is zero)

Clicking anywhere on the green side sends the request. Clicking anywhere on the red side cancels without sending.

Free Labelโ€‹

When the cost is zero or economy is disabled, all cost displays show "Free" instead of "0" or "0.0". This includes GUIs, chat messages, and the /tpalist cost column.

The label text is configurable in messages.yml:

placeholders:
free: "<grey>Free"

Dynamic Pricingโ€‹

Instead of a flat cost for everyone, you can define balance-bracket tiers. The first tier whose ceiling the player's balance is below wins.

economy:
tpa:
cost: 500.0 # fallback โ€” used when player exceeds all tiers
dynamic-pricing:
enabled: true
tiers:
- max-balance: 100000 # balance under 100k โ†’ charged 50
cost: 50.0
- max-balance: 1000000 # balance under 1M โ†’ charged 200
cost: 200.0
- max-balance: 10000000 # balance under 10M โ†’ charged 1000
cost: 1000.0
# players with 10M+ โ†’ charged flat 500.0

Each teleport type (TPA, TPAhere, Home, Warp default) has its own independent dynamic pricing block.

Note for Warps: Dynamic pricing only affects the default warp cost. Individual per-warp price overrides in warps.yml are always flat and always take priority.

Economy Bypassโ€‹

Players with teleporterpro.economy.bypass are never charged for any teleport type. Useful for staff accounts.

Refund on Failed Teleportโ€‹

If a teleport fails after the charge is applied (e.g. blocked by another plugin), the player is automatically refunded and shown a notification.