OmniTool API
The EdToolsOmniToolAPI allows you to manage OmniTools, which are special items that can have multiple functions or appearances.
Get API Instance
EdToolsOmniToolAPI omniToolAPI = EdToolsAPI.getInstance().getOmniToolAPI();Methods
getOmniToolItem(Player owner, String toolId)
getOmniToolItem(Player owner, String toolId)Creates an ItemStack for a specific OmniTool.
owner: The player who will be the owner of the tool.toolId: The ID of the OmniTool as defined in the configuration.Returns: An
ItemStackof the requested OmniTool.
getOmniToolFromPlayer(Player owner)
getOmniToolFromPlayer(Player owner)Returns an ItemStack. It will return null if player has no omnitool on their inventory.
player: The player to get the omnitool from.
isItemOmniTool(ItemStack item)
isItemOmniTool(ItemStack item)Checks if a given ItemStack is a valid OmniTool.
item: The item to check.Returns:
trueif the item is an OmniTool,falseotherwise.
getOmniToolId(ItemStack item)
getOmniToolId(ItemStack item)Retrieves the unique ID of an OmniTool from its ItemStack.
item: The OmniToolItemStack.Returns: A
Stringcontaining the tool's ID, ornullif it's not an OmniTool.
loadTool(String toolId, ConfigurationSection toolSec)
loadTool(String toolId, ConfigurationSection toolSec)Loads a new OmniTool into the plugin at runtime from a configuration section.
toolId: The unique ID for this new tool.toolSec: TheConfigurationSectioncontaining the tool's definition.
Last updated
Was this helpful?