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

net.minestom.server.inventory.condition.InventoryCondition Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
package net.minestom.server.inventory.condition;

import net.minestom.server.entity.Player;
import net.minestom.server.inventory.AbstractInventory;
import net.minestom.server.inventory.click.ClickType;

/**
 * Can be added to any {@link AbstractInventory}
 * using {@link net.minestom.server.inventory.Inventory#addInventoryCondition(InventoryCondition)}
 * or {@link net.minestom.server.inventory.PlayerInventory#addInventoryCondition(InventoryCondition)}
 * in order to listen to any issued clicks.
 */
@FunctionalInterface
public interface InventoryCondition {

    /**
     * Called when a {@link Player} clicks in the inventory where this {@link InventoryCondition} has been added to.
     *
     * @param player                   the player who clicked in the inventory
     * @param slot                     the slot clicked, can be -999 if the click is out of the inventory
     * @param clickType                the click type
     * @param inventoryConditionResult the result of this callback
     */
    void accept(Player player, int slot, ClickType clickType, InventoryConditionResult inventoryConditionResult);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy