Class PlayerPurchaseProductEvent


public class PlayerPurchaseProductEvent extends PlayerEconomyEvent
Called after a Player purchases something
  • Constructor Details

    • PlayerPurchaseProductEvent

      public PlayerPurchaseProductEvent(@NotNull @NotNull Player p, @NotNull @NotNull BusinessProduct product, @Nullable BusinessStatistics.Transaction transaction, int amount)
      Constructs a PlayerPurchaseProductEvent.
      Parameters:
      p - Player that purchased product
      product - BusinessProduct used
      transaction - The Transaction of the Purchase
      amount - Amount of product purchased
  • Method Details

    • getProduct

      @NotNull public @NotNull BusinessProduct getProduct()
      Fetches the BusinessProduct involved in this event.
      Returns:
      Product player bought
    • getPurchasedAmount

      public int getPurchasedAmount()
      Fetches the amount of the product purchased.
      Returns:
      Amount of product purchased
    • getTransaction

      @Nullable public BusinessStatistics.Transaction getTransaction()
      Fetches the transaction involved in this event.
      Returns:
      Transaction of the purchase