Class AutoSellAnnounceEvent

java.lang.Object
org.bukkit.event.Event
com.vk2gpz.autosell.event.AutoSellAnnounceEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class AutoSellAnnounceEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
This event is called when a player sells items automatically. It is used to modify the total amount of money earned and the number of items sold.

This event is cancellable, and if cancelled, the sale will not be processed.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    AutoSellAnnounceEvent(org.bukkit.entity.Player player, double total, int amountOfItemsSold)
    Creates a new AutoSellAnnounceEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the number of items sold.
    static org.bukkit.event.HandlerList
    Gets the handler list for this event.
    @NotNull org.bukkit.event.HandlerList
    Gets the handler list for this event.
    org.bukkit.entity.Player
    Gets the player who sold the items.
    double
    Gets the total amount of money earned from the sale.
    boolean
    Gets whether the event is cancelled or not.
    void
    setAmountOfItemsSold(int amountOfItemsSold)
    Sets the number of items sold.
    void
    setCancelled(boolean cancelled)
    Sets whether the event is cancelled or not.
    void
    setTotal(double total)
    Sets the total amount of money earned from the sale.

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

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

    • AutoSellAnnounceEvent

      public AutoSellAnnounceEvent(org.bukkit.entity.Player player, double total, int amountOfItemsSold)
      Creates a new AutoSellAnnounceEvent.
      Parameters:
      player - The player who sold the items.
      total - The total amount of money earned from the sale.
      amountOfItemsSold - The number of items sold.
  • Method Details

    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Gets the player who sold the items.
      Returns:
      The player who sold the items.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the handler list for this event.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      The handler list for this event.
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Gets the handler list for this event.
      Returns:
      The handler list for this event.
    • getTotal

      public double getTotal()
      Gets the total amount of money earned from the sale.
      Returns:
      The total amount of money earned from the sale.
    • setTotal

      public void setTotal(double total)
      Sets the total amount of money earned from the sale.
      Parameters:
      total - The total amount of money earned from the sale.
    • getAmountOfItemsSold

      public int getAmountOfItemsSold()
      Gets the number of items sold.
      Returns:
      The number of items sold.
    • setAmountOfItemsSold

      public void setAmountOfItemsSold(int amountOfItemsSold)
      Sets the number of items sold.
      Parameters:
      amountOfItemsSold - The number of items sold.
    • isCancelled

      public boolean isCancelled()
      Gets whether the event is cancelled or not.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      Whether the event is cancelled or not.
    • setCancelled

      public void setCancelled(boolean cancelled)
      Sets whether the event is cancelled or not.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancelled - Whether the event is cancelled or not.