I have a problem with get a list in a config. My code: Code: foreach($this->getConfig()->get("sms.vip.info") as $i) { $sender->sendMessage($i); } return true; If i use command show errors: Code: [22:53:50] [Server thread/INFO]: An unknown error occurred while attempting to perform this command [22:53:50] [Server thread/CRITICAL]: Unhandled exception executing command 'sms' in sms: Invalid argument supplied for foreach() [22:53:50] [Server thread/WARNING]: RuntimeException: "Invalid argument supplied for foreach()" (E_WARNING) in "/Sms/src/Sms/Main" at line 36 config.yml Code: --- sms: vip: info: - "32 Itemy" - "32 Diaxy" ... Help me, please.
How I can add color to config &? In java (spigot) is Code: ChatColor.translateAltrenateColorCodes('&', Main.getInstance().getConfig("..."); But how is in PocketMineMP?
use\pocketmine\... <-- for colors? Please help me... Code: $i = preg_replace('/&([0-9a-f])/', "\xc2\xa7$1", $i); This don't work.
It's exactly what TextFormat does. https://github.com/PocketMine/PocketMine-MP/blob/master/src/pocketmine/utils/TextFormat.php#L30-L52
I simply gave him the correct code for what he wants. I didn't tell anyone to use getNested instead of get.