0

I really need help with this. I tried a lot of suggestions online from a google search but I didn't get much. Some solutions I tried to come up with myself were:

public LunarCore plugin = new LunarCore();

but I don't know for sure if that will work. Here is my code

IconMenu menu = new IconMenu("Idle Menu", 9, new IconMenu.OptionClickEventHandler() {
    @Override
    public void onOptionClick(IconMenu.OptionClickEvent event) {
        event.getPlayer().sendMessage("You have chosen " + event.getName());
        event.setWillClose(true);
    }
}, plugin)
.setOption(3, new ItemStack(Material.GOLD_INGOT, 1), "Shop")

And obviously it is on

        }
}, plugin)

"plugin"

1 Answer 1

1

In case this is a class seperated from your main-class, try

private Plugin plugin;

public InventoryClassName(Plugin plugin){

this.plugin = plugin;

}

and then pass on "this" as parameter when accessing the class through your main-class

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.