Interface MmoItemsApi


public interface MmoItemsApi
The public API for managing and querying custom items in MMO-Items.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.inventory.ItemStack
    createCustomItem(@NotNull String itemId)
    Generates a new ItemStack of the custom MMO-Item type.
    @NotNull Optional<String>
    getCustomItemId(@NotNull org.bukkit.inventory.ItemStack item)
    Retrieves the custom MMO-Item ID associated with the given ItemStack.
    boolean
    isCustomItem(@NotNull org.bukkit.inventory.ItemStack item)
    Checks if the given ItemStack is a custom MMO-Item.
    boolean
    isFeatureEnabled(@NotNull org.bukkit.entity.Player player)
    Checks if the MMO-Items admin features are enabled for the player.
    void
    sendMessage(@NotNull org.bukkit.entity.Player player, @NotNull String message)
    Sends a MiniMessage styled message to the player.
  • Method Details

    • sendMessage

      void sendMessage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String message)
      Sends a MiniMessage styled message to the player.
      Parameters:
      player - the recipient player
      message - the MiniMessage formatted message string
    • isFeatureEnabled

      boolean isFeatureEnabled(@NotNull @NotNull org.bukkit.entity.Player player)
      Checks if the MMO-Items admin features are enabled for the player.
      Parameters:
      player - the player to check permissions for
      Returns:
      true if features are enabled, false otherwise
    • isCustomItem

      boolean isCustomItem(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Checks if the given ItemStack is a custom MMO-Item.
      Parameters:
      item - the item stack to check
      Returns:
      true if it contains the custom item PDC tag, false otherwise
    • getCustomItemId

      @NotNull @NotNull Optional<String> getCustomItemId(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Retrieves the custom MMO-Item ID associated with the given ItemStack.
      Parameters:
      item - the item stack to query
      Returns:
      an Optional containing the custom item ID if present, otherwise empty
    • createCustomItem

      @NotNull @NotNull org.bukkit.inventory.ItemStack createCustomItem(@NotNull @NotNull String itemId)
      Generates a new ItemStack of the custom MMO-Item type.
      Parameters:
      itemId - the unique registration ID of the custom item configuration
      Returns:
      a new styled ItemStack tagged with the custom item ID
      Throws:
      IllegalArgumentException - if the custom item type is unknown or material is invalid