Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $nbt = new CompoundTag( "", [
- "Pos" => new ListTag(
- "Pos", [
- new DoubleTag("", $player->x),
- new DoubleTag("", $player->y+$player->getEyeHeight()),
- new DoubleTag("", $player->z)
- ]),
- "Motion" => new ListTag("Motion", [
- new DoubleTag("", -\sin ($player->yaw / 180 * M_PI) *\cos ($player->pitch / 180 * M_PI)),
- new DoubleTag ("", -\sin ($player->pitch / 180 * M_PI)),
- new DoubleTag("",\cos ($player->yaw / 180 * M_PI) *\cos ( $player->pitch / 180 * M_PI))
- ] ),
- "Rotation" => new ListTag("Rotation", [
- new FloatTag("", $player->yaw),
- new FloatTag("", $player->pitch)
- ] )
- ] );
- $f = 3.0;
- $snowball = Entity::createEntity("Snowball", $player->getlevel(), $nbt);
- $snowball->setMotion($snowball->getMotion()->multiply($f));
- $snowball->spawnToAll();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement