Last active
September 1, 2020 07:23
-
-
Save PJZ9n/e1a84eb3c5f04106792afb0e1baf4a88 to your computer and use it in GitHub Desktop.
浮き文字
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 | |
declare(strict_types=1); | |
use pocketmine\level\Level; | |
use pocketmine\level\particle\FloatingTextParticle; | |
use pocketmine\math\Vector3; | |
use pocketmine\plugin\Plugin; | |
use pocketmine\scheduler\ClosureTask; | |
/** @var Vector3 $pos */ | |
$particle = new FloatingTextParticle($pos, "テキスト\n改行あああ", "タイトル(任意)");//パーティクル作成 | |
/** @var Level $level */ | |
$level->addParticle($particle);//ワールドに出す | |
//タスク | |
$task = new ClosureTask(function (int $currentTick) use ($particle, $level): void { | |
$particle->setInvisible(true);//パーティクルを見えなくする(これ以外に消す方法あるかも) | |
$level->addParticle($particle);//見えなくしたのを反映させる | |
}); | |
/** @var Plugin $plugin */ | |
$plugin->getScheduler()->scheduleDelayedTask($task, 20 * 5);//5秒後に実行 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment