net.minestom.server.event.trait.CancellableEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.event.trait;
import net.minestom.server.event.Event;
import net.minestom.server.event.EventDispatcher;
/**
* Represents an {@link Event} which can be cancelled.
* Called using {@link EventDispatcher#callCancellable(CancellableEvent, Runnable)}.
*/
public interface CancellableEvent extends Event {
/**
* Gets if the {@link Event} should be cancelled or not.
*
* @return true if the event should be cancelled
*/
boolean isCancelled();
/**
* Marks the {@link Event} as cancelled or not.
*
* @param cancel true if the event should be cancelled, false otherwise
*/
void setCancelled(boolean cancel);
}