Hey all, in my recent post it can be seen that the format event doesn't seem to be working. But after fixing things, it seems to be that only the player colors entered for the displayname doesn't seem to be working: they all seem to default to &7. Example: Owner: (gray)Aero >> (in yellow)Heyo! Default: (gray)Aero >> (in gray)Heyo! Can anyone help fix? PHP: @EventHandler public void onPlayerChat(PlayerChatEvent e) { Player player = e.getPlayer(); if (player.hasPermission("pbasic.chat.normal")) { e.setFormat("§7%1$s » %2$s"); player.setDisplayName("§7" + player.getDisplayName()); player.setPlayerListName("§7" + player.getDisplayName()); } else if (player.hasPermission("pbasic.chat.investor")) { e.setFormat("§a%1$s §f» %2$s"); player.setDisplayName("§a" + player.getDisplayName()); player.setPlayerListName("§a" + player.getDisplayName()); } else if (player.hasPermission("pbasic.chat.expert")) { e.setFormat("§6%1$s §f» %2$s"); player.setDisplayName("§6" + player.getDisplayName()); player.setPlayerListName("§6" + player.getDisplayName()); } else if (player.hasPermission("pbasic.chat.titan")) { e.setFormat("§9§o%1$s §f» §3%2$s"); player.setDisplayName("§9§o" + player.getDisplayName()); player.setPlayerListName("§9§o" + player.getDisplayName()); } else if (player.hasPermission("pbasic.chat.supervisor")) { e.setFormat("§d%1$s §f» §e%2$s"); player.setDisplayName("§d" + player.getDisplayName()); player.setPlayerListName("§d" + player.getDisplayName()); } else if (player.hasPermission("pbasic.chat.mod")) { e.setFormat("§5%1$s §f» §e%2$s"); player.setDisplayName("§5" + player.getDisplayName()); player.setPlayerListName("§5" + player.getDisplayName()); } else if (player.hasPermission("pbasic.chat.mod+")) { e.setFormat("§5§o%1$s §f» §e%2$s"); player.setDisplayName("§5§o" + player.getDisplayName()); player.setPlayerListName("§5§o" + player.getDisplayName()); } else if (player.hasPermission("pbasic.chat.dev")) { e.setFormat("§b§o%1$s §f» §e%2$s"); player.setDisplayName("§b§o" + player.getDisplayName()); player.setPlayerListName("§b§o" + player.getDisplayName()); } else if (player.hasPermission("pbasic.chat.admin")) { e.setFormat("§c%1$s §f» §e%2$s"); player.setDisplayName("§c" + player.getDisplayName()); player.setPlayerListName("§c" + player.getDisplayName()); } else if (player.hasPermission("pbasic.chat.owner") || player.isOp() || player.hasPermission("*")) { e.setFormat("§4%1$s §f» §e%2$s"); player.setDisplayName("§4" + player.getDisplayName()); player.setPlayerListName("§4" + player.getDisplayName()); } }
@AeroLiquid What colors entered? Like somebody chats this: If so: you need to translate that as well so it will use the colors.
Reread my first comment again: whenever someone with the appropriate permission chats, the display name of player automatically converts to &7, but the message the player says is as specified. So let's say I'm a dev of the server and I chat, I am supposed to receive the display name of "&b&o" but instead I get &7 - the default. That is the issue I need to be fixed.
@timtower yes I do. I've also cancelled out the permissions that the group doesn't need e.g - -pbasic.default in Each group (besides Default of course)
@AeroLiquid Then there is your issue. It finds that permissions, and because you are using else if it won't even check the other permissions. That is why you are getting the normal format.