All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.event.player.PlayerAchievementAwardedEvent Maven / Gradle / Ivy

The newest version!
package org.bukkit.event.player;

import org.bukkit.Achievement;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;

/**
 * Called when a player earns an achievement.
 */
public class PlayerAchievementAwardedEvent extends PlayerEvent implements Cancellable {
  private static final HandlerList handlers = new HandlerList();
  private final Achievement achievement;
  private boolean isCancelled = false;

  public PlayerAchievementAwardedEvent(Player player, Achievement achievement) {
    super(player);
    this.achievement = achievement;
  }

  public static HandlerList getHandlerList() {
    return handlers;
  }

  /**
   * Gets the Achievement being awarded.
   *
   * @return the achievement being awarded
   */
  public Achievement getAchievement() {
    return achievement;
  }

  public boolean isCancelled() {
    return isCancelled;
  }

  public void setCancelled(boolean cancel) {
    this.isCancelled = cancel;
  }

  @Override
  public HandlerList getHandlers() {
    return handlers;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy