Class PiglinBarterEvent

All Implemented Interfaces:
Cancellable

public class PiglinBarterEvent extends EntityEvent implements Cancellable
Stores all data related to the bartering interaction with a piglin. This event can be triggered by a piglin picking up an item that's on its bartering list.
  • Constructor Details

  • Method Details

    • getEntity

      @NotNull public Piglin getEntity()
      Description copied from class: EntityEvent
      Returns the Entity involved in this event
      Overrides:
      getEntity in class EntityEvent
      Returns:
      Entity who is involved in this event
    • getInput

      @NotNull public ItemStack getInput()
      Gets the input of the barter.
      Returns:
      The item that was used to barter with
    • getOutcome

      @NotNull public List<ItemStack> getOutcome()
      Returns a mutable list representing the outcome of the barter.
      Returns:
      A mutable list of the item the player will receive
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Cancellable
      Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      true if this event is cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: Cancellable
      Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getHandlers

      @NotNull public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      @NotNull public static HandlerList getHandlerList()