![JAR search and dependency download from the Maven repository](/logo.png)
net.minestom.server.inventory.condition.InventoryCondition 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.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