Skip to content

Instantly share code, notes, and snippets.

@HimbeersaftLP
Created April 16, 2017 21:38
Show Gist options
  • Save HimbeersaftLP/6f9039b37635a04b1f4c1f76316c8f0d to your computer and use it in GitHub Desktop.
Save HimbeersaftLP/6f9039b37635a04b1f4c1f76316c8f0d to your computer and use it in GitHub Desktop.
Demonstration of the addTitle function in pmmp
<?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