Class VillagerReputationChangeEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.bukkit.event.entity.VillagerReputationChangeEvent
All Implemented Interfaces:
Cancellable

public class VillagerReputationChangeEvent extends EntityEvent implements Cancellable
Called whenever an entity's reputation with a villager changes.
  • Constructor Details Link icon

  • Method Details Link icon

    • getTargetUUID Link icon

      @NotNull public UUID getTargetUUID()
      Get UUID of the entity for whom the reputation with a villager changes.
      Returns:
      UUID of the entity for whom the reputation with a villager changes
    • getTarget Link icon

      @Nullable public Entity getTarget()
      Get the Entity for whom the reputation with a villager changes.
      Returns:
      the Entity for whom the reputation with a villager changes, or null if it isn't found
    • getReason Link icon

      @NotNull public Villager.ReputationEvent getReason()
      Get the reason of this reputation change.
      Returns:
      the reason of this reputation change
    • getReputationType Link icon

      @NotNull public Villager.ReputationType getReputationType()
      Get the type of changed reputation.
      Returns:
      the type of changed reputation
    • getOldValue Link icon

      public int getOldValue()
      Get the reputation value before the change.
      Returns:
      the reputation value before the change
    • getNewValue Link icon

      public int getNewValue()
      Get new reputation value after the change.
      Returns:
      the reputation value after the change
    • setNewValue Link icon

      public void setNewValue(int newValue)
      Set new reputation value for this event.

      If the final value is below the reputation discard threshold, gossip associated with this reputation type will be removed.

      The provided value must be between 0 and getMaxValue(), otherwise an IllegalArgumentException will be thrown. Each reputation type may have a different maximum value.

      Parameters:
      newValue - the reputation value after the change
      See Also:
    • getMaxValue Link icon

      public int getMaxValue()
      Get maximum value for the reputation type affected by this event.
      Returns:
      the maximum value for the reputation type affected by this event
      See Also:
    • isCancelled Link icon

      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 Link icon

      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
    • getEntity Link icon

      @NotNull public Villager 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
    • getHandlers Link icon

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

      @NotNull public static HandlerList getHandlerList()