PHP: public function onCommand(CommandSender $sender, Command $cmd, $label, array $args){ if($cmd->getName() === "hi") // checks that the command is /hi { if(isset($args[0])) // check that <player> was given { $sendTo = $this->getServer()->getPlayer($args[0]) if($sendTo !== null && $sendTo->isOnline()) // check that the given player is online { $sendTo->sendMessage("your message goes here") } else { $sender->sendMessage(TextFormat::WHITE. $args[0] .TextFormat::RED." is not online!") } } else { $sender->sendMessage(TextFormat::RED."Please specify a player!") } }} In the future, please show what you've tried to do, because it won't help you if we just give you code and you don't try