My LoginLogout plugin http://forums.bukkit.org/threads/ch...n-and-logout-messages-1060.35966/#post-661471 Is going to have a new feature, show the world where the player logs in... and there is a boolean at config that I added that is called Show.World, Its supose so if you set it to false then it doesnt show the world where the player logs in but if I set it to false, it keeps showing in what world the player logged in, why??? Code:java config.setProperty("Show.World", "true"); That is how I setted up the boolean and Code:java public void onPlayerJoin(PlayerJoinEvent event) { plugin.config.load(); boolean useworld = plugin.config.getBoolean("Show.World", true); Player player = event.getPlayer(); String world = player.getWorld().getName(); event.setJoinMessage(null); if (useworld) { if (!event.getPlayer().isOp()) { plugin.config.load(); event.setJoinMessage(colorizeText(plugin.config .getString("prefix.Player") + player.getName() + plugin.config.getString("Join.Player") + " @ " + world)); } else { plugin.config.load(); event.setJoinMessage(colorizeText(plugin.config .getString("prefix.Op") + player.getName() + plugin.config.getString("Join.Op") + " @ " + world)); } } else { if (!event.getPlayer().isOp()) { plugin.config.load(); event.setJoinMessage(colorizeText(plugin.config .getString("prefix.Player") + player.getName() + plugin.config.getString("Join.Player"))); } else { plugin.config.load(); event.setJoinMessage(colorizeText(plugin.config .getString("prefix.Op") + player.getName() + plugin.config.getString("Join.Op"))); } } } this is the playerjoinevent what is wrong with it > finished typing the post (finally ) EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Where is the setProperty call? if it is in the onEnable of your main class and not surrounded with a proper conditional statement, it will keep setting the property to true no matter what it is set to, so when the onPlayerJoin event fires it will only read the true value.
Pretty much what @Sagacious_Zed said. Change setProperty to getBoolean. If there is no "Show.World" property, it will create one and use true as the default value. That is, of course, untested. But I assume it works.
Yes you can make calls to getBoolean that way. If the node does not exist it will return the given default. In fact, if config.yml does not exist it will return the default. The pitfall here is if you don't call getConfiguration().load() to actually load the config file from disk, it will always return the default.