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
ItemStack
of the requested OmniTool.
isItemOmniTool(ItemStack item)
isItemOmniTool(ItemStack item)
Checks if a given ItemStack
is a valid OmniTool.
item
: The item to check.Returns:
true
if the item is an OmniTool,false
otherwise.
getOmniToolId(ItemStack item)
getOmniToolId(ItemStack item)
Retrieves the unique ID of an OmniTool from its ItemStack
.
item
: The OmniToolItemStack
.Returns: A
String
containing the tool's ID, ornull
if 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
: TheConfigurationSection
containing the tool's definition.
Was this helpful?