Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Float texts

Comments in 'Plugin Development' started by AndrewBit, Oct 16, 2015.

Thread Status:
Not open for further replies.
  1. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    How I can create float texts? Answer with PHP, please :)
  2. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    PHP:
    use pocketmine\math\Vector3 as Vector3;
    use 
    pocketmine\level\Level;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\level\particle\FloatingTextParticle
    Use this first then add this:

    PHP:
    public function onCommand(CommandSender $senderCommand $command$label, array $args) {
     switch(
    $command->getName()) {
     case 
    "settext":$player $this->getServer()->getPlayer($sender->getName());$text array_shift($args);$x $player->getFloorX();$y $player->getFloorY() + 2;$z $player->getFloorZ();$player->getLevel()->addParticle(new FloatingTextParticle(new Vector3($x$y$z), $text));
     } 
     } 
  3. Intyre
    Offline

    Intyre Staff Member PocketMine Team

    Joined:
    Aug 24, 2013
    Posts:
    118
    Minecraft User:
    Intyre
    with PHP
Thread Status:
Not open for further replies.

Share This Page

Advertisement