1
Deleted
[deleted]
Create an account or sign in to comment.
1
1
it's because your method signature is
instead of
The event should be the only parameter.
What you can do instead is
So you can initialize the plugin variable outside of the chat event method once the class is initialized, and you will still be able to use the variable within the event method
public void onPlayerChat(AsyncPlayerChatEvent event, Plugin pl)
instead of
public void onPlayerChat(AsyncPlayerChatEvent event)
The event should be the only parameter.
What you can do instead is
private Plugin plugin;
public PlayerChat(Plugin plugin) {
this.plugin = plugin;
}
So you can initialize the plugin variable outside of the chat event method once the class is initialized, and you will still be able to use the variable within the event method