Solved Join Msg Option

Discussion in 'Plugin Development' started by SeniorCluckers, Aug 3, 2016.

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

    SeniorCluckers

    Hi Everyone, not really sure why this isn't working... What I'm trying to do is check the config, then if the string "join" is equal to false then disable the join msg.. I am registering my event, and have the config option. But this doesn't seem to be working.

    Code:
        @EventHandler
        public void onPlayerJoin(PlayerJoinEvent event) {
         
            if(Main.getInstance().getConfig().getBoolean("join") == false) {
                event.setJoinMessage(null);
            }
         
        }
     
  2. Offline

    Mokum

    Possible reasons why:
    • You haven't registered the event in the Main class.
    • You haven't implemented Listener to the listener's class
    • You have not correctly initialized the Main instance
    • The config does not contain the "join" boolean
    I can't really assist any more due to lack of information.
     
  3. @SeniorCluckers Don't compare a boolean with a boolean to return a boolean. Just use the 1 boolean
     
  4. Offline

    SeniorCluckers

    @Mokes
    It says solved, but thank you. To answer what was wrong, my main class had a typo.


    @bwfcwalshy
    What do you mean? What I did worked perfectly and see nothing wrong with it.

    EDIT Are you saying I don't need to check the boolean if its true/false?
     
  5. Offline

    kindak

    no he is saying that you dont need to piel up the booleans just use one of them :p
     
  6. Offline

    SeniorCluckers

Thread Status:
Not open for further replies.

Share This Page