Is there any ability to control the length of message? If players have long prefixes, part of message is out of the screen, so how can I trim the message and put the rest of it on the next line?
PHP: final $LINE_LENGTH=40;$lines=floor(strlength($message)/$LINE_LENGTH)+1;$output=array();for($i=0;$i<$lines;$i++){ $output[$i]=substr($message,$i*$LINE_LENGTH,$LINE_LENGTH);$player->sendchat(implode('\n',$output));} Is it substr or substring?
In /pocketmine/src/api/ChatAPI.php: PHP: public function send($owner, $text, $whitelist = false, $blacklist = false){ $message = array( "player" => $owner, "message" => $text, ); if($owner !== false){ if($owner instanceof Player){ if($whitelist === false){ console("[INFO] <".$owner->username."> ".$text); } }else{ if($whitelist === false){ console("[INFO] <".$owner."> ".$text); } } }else{ if($whitelist === false){ console("[INFO] $text"); } $message["player"] = ""; }////////--------********This is the place********--------//////// $this->server->handle("server.chat", new Container($message, $whitelist, $blacklist)); }} This is not the ultimate code of chat output, but this is the boundary of my knowledge to pocketmine. Add the code there (of course change the variable names. CAUTION: YOU MUST KNOW WHAT YOU ARE DOING WHEN ADDING THE CODE BECAUSE THIS IS SRC CODE AND MOREOVER IT IS NOT DEBUGGED. Also this is just purely theory don't tell me what severe consequences it brings. I am not responsible for them.
Do u replace it with the code that is already there or not I pasted them together then just that code still both didn't work they just crashed sever