Solved Help! get config at listener

Discussion in 'Plugin Development' started by rawiuwt, Jul 26, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    rawiuwt

    Can I use getConfig() at listener class or How to send boolean from listener back to main class?
     
  2. Offline

    FurmigaHumana

    Simple way: Add the plugin instance to your listener class like this:

    Code:
    public yourListenerClass implements Listener {
       
        private YourPluginClass plugin;
     
        public yourListenerClass(YourPluginClass plugin) {
             this.plugin = plugin;
        }
     
        @EventHandler
        public void onEvent..............{
     
             boolean theBoolean = plugin.getConfig("node");
             
        }
    }
     
Thread Status:
Not open for further replies.

Share This Page