Hey, I am making a chat format plugin and when I set Join Message Enable to False in my config file it stills give a Join Message. Spoiler: Join Message Code Code (Java): @EventHandler public void onJoin(PlayerJoinEvent e){ Player p = e.getPlayer(); if (config.getBoolean("First Join Message Enabled",true)){ if (!p.hasPlayedBefore()){ Bukkit.broadcastMessage(Utils.chat(config.getString("First Join Message").replace("<player>", p.getName()))); e.setJoinMessage(null); } } if (config.getBoolean("Join Message Enabled", true)) { e.setJoinMessage(Utils.chat(config.getString("Join Message").replace("<player>", p.getName()))); } else { e.setJoinMessage(null); } }
Can we see your config? Also I may be mistaken but you can't have spaced in your path, use underscores or dashes instead. And: if (config.getBoolean("First Join Message Enabled",true)){ can simply be replaced with if (config.getBoolean("First Join Message Enabled")) {.
Sure Code (Text): First Join Message Enabled: 'true' First Join Message: '&d <player> &ehas joined the server for the first time!' Join Message Enabled: 'true' Join Message: '&d <player> &ehas joined the server.' Leave Message Enabled: 'true' Leave Message: '&d <player> &ehas left the server.'
Having quotes around your boolean will return a string, try it without the '. So Leave Message Enabled: true
The plugin can't find the boolean in the config. And since you are using that method, it will always default to "true".
I didn't know you can put space in a yaml Also with quotes it means it's a string as stated before. Make sure the event is registered Code (Java): if (config.getBoolean("Join Message Enabled")) { e.setJoinMessage(Utils.chat(config.getString("Join Message").replace("<player>", p.getName()))); } else { e.setJoinMessage(null); }