void ElytraTarget(Vector3 target) {
Vector3 playerPos = GetPlayerPosition(); // Получаем позицию игрока
Vector3 direction = (target - playerPos).Normalize(); // Вычисляем вектор направления
float speed = 1.8f; // Скорость полёта, можно настраивать
player.motionX = direction.x * speed;
player.motionY = direction.y * speed;
player.motionZ = direction.z * speed;
// Если падаем слишком быстро – запускаем фейерверк
if (player.motionY < -0.1f) {
UseFirework();
}
}
void UseFirework() {
int slot = FindFireworkSlot(); // Поиск слота с фейерверками
if (slot != -1) {
SendPacket(CPlayerTryUseItemPacket()); // Отправка пакета
}
}