Skip to content

Economy

Sven Rahn edited this page Aug 3, 2019 · 3 revisions

Official docs: https://docs.spongepowered.org/stable/en/plugin/economy/index.html

Example scripts:

Helpers from KtSkript:

Snippets:

val player: Player
val acc1 = player.economyAccount

acc1 += 10.toBigDecimal()
acc1 -= 10.toBigDecimal()
player.sendMessage("${acc1.balance.toInt()} is your balance.".t)

val acc2 = EconomyService.getAccount("some-virtual-account")
acc2 += 10.toBigDecimal()
acc2 -= 10.toBigDecimal()

val amount1 = acc2.balance
val amount2 = amount1 * 20
val amount3 = amount1 - 10.5
val amount4 = amount1 + amount2 / 3.5
Clone this wiki locally