Interface ItemProvider


public interface ItemProvider
Represents a specific item provider (e.g. Vanilla, Nexo, ItemsAdder, CraftEngine, etc.).
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable org.bukkit.inventory.ItemStack
    getItem(@NotNull String id, int amount)
    Gets an item stack by its ID.
    int
    getItemCount(@NotNull org.bukkit.entity.Player player, @NotNull String id)
    Gets the count of matching items in the player's inventory.
    @NotNull String
    Gets the unique name of this item provider.
    boolean
    giveItem(@NotNull org.bukkit.entity.Player player, @NotNull String id, int amount)
    Gives an item to the player.
    boolean
    Checks if this item provider is available.
    boolean
    takeItem(@NotNull org.bukkit.entity.Player player, @NotNull String id, int amount)
    Takes an item from the player's inventory.
  • Method Details

    • getName

      @NotNull @NotNull String getName()
      Gets the unique name of this item provider.
      Returns:
      the provider name
    • isAvailable

      boolean isAvailable()
      Checks if this item provider is available.
      Returns:
      true if available, false otherwise
    • getItem

      @Nullable @Nullable org.bukkit.inventory.ItemStack getItem(@NotNull @NotNull String id, int amount)
      Gets an item stack by its ID.
      Parameters:
      id - the item ID
      amount - the item quantity
      Returns:
      the item stack, or null if not found
    • giveItem

      boolean giveItem(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, int amount)
      Gives an item to the player.
      Parameters:
      player - the player
      id - the item ID
      amount - the item quantity
      Returns:
      true if successful, false otherwise
    • takeItem

      boolean takeItem(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, int amount)
      Takes an item from the player's inventory.
      Parameters:
      player - the player
      id - the item ID
      amount - the item quantity to take
      Returns:
      true if successful, false otherwise
    • getItemCount

      int getItemCount(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id)
      Gets the count of matching items in the player's inventory.
      Parameters:
      player - the player
      id - the item ID
      Returns:
      the number of matching items in player's inventory