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

net.minestom.server.event.trait.CancellableEvent Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
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);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy