Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. $nbt = new CompoundTag( "", [
  2.                 "Pos" => new ListTag(
  3.                 "Pos", [
  4.                     new DoubleTag("", $player->x),
  5.                     new DoubleTag("", $player->y+$player->getEyeHeight()),
  6.                     new DoubleTag("", $player->z)
  7.                 ]),
  8.                 "Motion" => new ListTag("Motion", [
  9.                         new DoubleTag("", -\sin ($player->yaw / 180 * M_PI) *\cos ($player->pitch / 180 * M_PI)),
  10.                         new DoubleTag ("", -\sin ($player->pitch / 180 * M_PI)),
  11.                         new DoubleTag("",\cos ($player->yaw / 180 * M_PI) *\cos ( $player->pitch / 180 * M_PI))
  12.                 ] ),
  13.                 "Rotation" => new ListTag("Rotation", [
  14.                         new FloatTag("", $player->yaw),
  15.                         new FloatTag("", $player->pitch)
  16.                 ] )
  17.         ] );
  18.        
  19.        
  20.         $f = 3.0;
  21.          $snowball = Entity::createEntity("Snowball", $player->getlevel(), $nbt);
  22.         $snowball->setMotion($snowball->getMotion()->multiply($f));
  23.         $snowball->spawnToAll();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement