Created
April 16, 2017 21:38
-
-
Save HimbeersaftLP/6f9039b37635a04b1f4c1f76316c8f0d to your computer and use it in GitHub Desktop.
Demonstration of the addTitle function in pmmp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace HimbeersaftLP\MoveTitle; | |
use pocketmine\plugin\PluginBase; | |
use pocketmine\event\Listener; | |
use pocketmine\Player; | |
use pocketmine\event\player\PlayerMoveEvent; | |
class main extends PluginBase implements Listener{ | |
public function onEnable(){ | |
$this->getServer()->getPluginManager()->registerEvents($this,$this); | |
$this->getLogger()->info("MoveTitle by HimbeersaftLP enabled!"); | |
} | |
public function onMove(PlayerMoveEvent $event){ | |
$player = $event->getPlayer(); | |
$player->addTitle("Title", "Subtitle"); | |
$player->sendMessage("Title sent!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment