A simple event to be ran when a player uses the pickblock function.
public class PickBlockEvent extends BlockEvent implements Cancellable { private Player picker; private static HandlerList handlers = new HandlerList(); private boolean cancelled = false; public PickBlockEvent(@NotNull Block block) { super(block); } @Override public boolean isCancelled() { return cancelled; } @Override public void setCancelled(boolean cancel) { this.cancelled = cancel; } /** * modified depending on how Minecraft handles block picking * (could only be a material) */ public void setPickedItemStack(ItemStack stack) { this.pickedStack = pickedStack; } public Player getPicker() { return this.picker; } @NotNull @Override public HandlerList getHandlers() { return handlers; } @NotNull public static HandlerList getHandlerList() { return handlers; } }