How do you specify certain parameters in JAVA (Minecraft plugin development)?

package de.mateo161013.menuAPI; import de.mateo161013.menuAPI.listeners.InventoryListener; import org.bukkit.plugin.java.JavaPlugin; public final class MenuAPI extends JavaPlugin { @Override public void onEnable() { // Plugin startup logic getServer().getPluginManager().registerEvent(new InventoryListener(), ); } @Override public void onDisable() { // Plugin shutdown logic } }

This was my code & after InventoryListener(), I want to specify this as parameter for plugin, but the listener becomes this if I type this like this.

How do I solve it?

1 vote, average: 1.00 out of 1 (1 rating, 1 votes, rated)
You need to be a registered member to rate this.
Loading...
Subscribe
Notify of
4 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
KurixYT
1 month ago

this would refer the current object of the class. Since the class has no constructor, there can never be objects from it.

regex9
1 month ago
Reply to  KurixYT

Each class has a constructor. If no explicit constructor is defined, a standard constructor is created.