Class TakeExpAction

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

public class TakeExpAction extends Action
Represents an action that removes experience points from a player.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TakeExpAction(int amount)
    Constructs a TakeExpAction with a specified amount of experience to remove.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(org.bukkit.entity.Player target)
    Executes the action, deducting experience points from the target player.
    int
    Gets the amount of experience to be removed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TakeExpAction

      public TakeExpAction(int amount)
      Constructs a TakeExpAction with a specified amount of experience to remove.
      Parameters:
      amount - The amount of experience to remove.
      Throws:
      IllegalArgumentException - If the amount is negative.
  • Method Details

    • getAmount

      public int getAmount()
      Gets the amount of experience to be removed.
      Returns:
      The experience amount.
    • execute

      public void execute(org.bukkit.entity.Player target)
      Executes the action, deducting experience points from the target player. The experience cannot go below zero.
      Specified by:
      execute in class Action
      Parameters:
      target - The player whose experience will be reduced.