Skip to content

Instantly share code, notes, and snippets.

@PJZ9n
Last active May 17, 2020 12:15
Show Gist options
  • Save PJZ9n/7c9608e66d664d954f38ed01688258c4 to your computer and use it in GitHub Desktop.
Save PJZ9n/7c9608e66d664d954f38ed01688258c4 to your computer and use it in GitHub Desktop.
方角
<?php
if (!$sender instanceof Player) {
return true;
}
$basePos = $sender->asVector3();
$basePos = $basePos->add(0, 1, 0);//高さ上げ
switch ($sender->getDirection()) {
case 3:
$pos = $basePos->add(1, 0, 0);
break;
case 0:
$pos = $basePos->add(0, 0, 1);
break;
case 1:
$pos = $basePos->add(-1, 0, 0);
break;
case 2:
$pos = $basePos->add(0, 0, -1);
break;
}
$particle = new FloatingTextParticle($pos, "テキスト");
$sender->getLevel()->addParticle($particle);
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment