Class TakeMoneyAction
java.lang.Object
io.github.lucfr1746.llibrary.action.Action
io.github.lucfr1746.llibrary.action.list.TakeMoneyAction
Represents an action that deducts money from a player's balance.
-
Constructor Summary
ConstructorsConstructorDescriptionTakeMoneyAction(Double amount) Constructs a TakeMoneyAction with a specified amount to deduct. -
Method Summary
-
Constructor Details
-
TakeMoneyAction
Constructs a TakeMoneyAction with a specified amount to deduct.- Parameters:
amount- The amount of money to deduct.- Throws:
IllegalArgumentException- If the amount is negative.
-
-
Method Details
-
getAmount
Gets the amount of money to be deducted.- Returns:
- The amount of money.
-
execute
public void execute(org.bukkit.entity.Player target) Executes the action, withdrawing money from the target player's balance. If the economy system is not available, an exception is thrown.- Specified by:
executein classAction- Parameters:
target- The player whose balance will be deducted.- Throws:
IllegalStateException- If there is no economy system hooked.
-