Skip to content

Conversation

@nivcoo
Copy link
Contributor

@nivcoo nivcoo commented Oct 31, 2025

Hello,

I implement a way to add new tool mode through the api, it was not a simple thing lol.

I add PluginInitializeEvent event too.

@EventHandler
public void onWildToolsInit(PluginInitializeEvent event) {
    ToolsManager tm = event.getPlugin().getToolsManager();

    final ToolKind NORMAL = new ToolKind() {
        @Override public String id() { return "NORMAL"; }
        // Not required
        // @Override public int sortOrder() { return 0; }
        // @Override public boolean isSimilar(ItemStack stack, Tool tool) {
            //return tool.isSimilar(stack);
        //}
    };

    tm.registerToolKind(NORMAL, (type, name, cfg) -> new BaseTool(type, name, NORMAL) {} );

}

We can use it like that

We can also create class that extends BaseTool to edit existing methods or add new event too

I also fixed one issue i saw on tool DRAIN, that the ToolMode isn't the good one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant