PHP: switch (mt_rand(1,2)){case 1: // random 1$p->sendPopup("By Nawaf");break;case 2:// random 2$p->sendPopup("Love");break;}
Don't forget to define $p (which in this case, is a Player), you can simply define $p with whichever Event, you decide to choose. PHP: public function onDeath(PlayerDeathEvent $event){ //is used when the player dies$p = $event->getPlayer(); //gets the players, when the player dies//code} Also please don't forget to registerEvents in onEnable