Class TakeMoneyAction

java.lang.Object
io.github.lucfr1746.llibrary.action.Action
io.github.lucfr1746.llibrary.action.list.TakeMoneyAction

public class TakeMoneyAction extends Action
Represents an action that deducts money from a player's balance.
  • Constructor Details

    • TakeMoneyAction

      public TakeMoneyAction(Double amount)
      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

      public Double 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:
      execute in class Action
      Parameters:
      target - The player whose balance will be deducted.
      Throws:
      IllegalStateException - If there is no economy system hooked.