Package org.yuemi.mmoitems.api
Interface MmoItemsApi
public interface MmoItemsApi
The public API for managing and querying custom items in MMO-Items.
-
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.inventory.ItemStackcreateCustomItem(@NotNull String itemId) Generates a new ItemStack of the custom MMO-Item type.getCustomItemId(@NotNull org.bukkit.inventory.ItemStack item) Retrieves the custom MMO-Item ID associated with the given ItemStack.booleanisCustomItem(@NotNull org.bukkit.inventory.ItemStack item) Checks if the given ItemStack is a custom MMO-Item.booleanisFeatureEnabled(@NotNull org.bukkit.entity.Player player) Checks if the MMO-Items admin features are enabled for the player.voidsendMessage(@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 playermessage- 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
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
-