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

org.bukkit.event.block.BlockExpEvent Maven / Gradle / Ivy

package org.bukkit.event.block;

import org.bukkit.block.Block;
import org.bukkit.event.HandlerList;

/**
 * An event that's called when a block yields experience.
 */
public class BlockExpEvent extends BlockEvent {
  private static final HandlerList handlers = new HandlerList();
  private int exp;

  public BlockExpEvent(Block block, int exp) {
    super(block);

    this.exp = exp;
  }

  public static HandlerList getHandlerList() {
    return handlers;
  }

  /**
   * Get the experience dropped by the block after the event has processed
   *
   * @return The experience to drop
   */
  public int getExpToDrop() {
    return exp;
  }

  /**
   * Set the amount of experience dropped by the block after the event has
   * processed
   *
   * @param exp 1 or higher to drop experience, else nothing will drop
   */
  public void setExpToDrop(int exp) {
    this.exp = exp;
  }

  public HandlerList getHandlers() {
    return handlers;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy