fixed rangedattack spawning arrow with wrong y pos

This commit is contained in:
GameHerobrine 2025-05-14 23:23:43 +03:00
parent a8f504ad88
commit 0c6bf7648f
2 changed files with 2 additions and 3 deletions

View file

@ -1877,9 +1877,8 @@ class Player{
$this->entity->setPosition($newPos, $packet->yaw, $packet->pitch, $packet->bodyYaw);
}
$this->entity->updateAABB();
}else{
console("skipping movement packet");
}
break;
case ProtocolInfo::PLAYER_EQUIPMENT_PACKET:
if($this->spawned === false){

View file

@ -68,7 +68,7 @@ class TaskRangedAttack extends \TaskBase
$arrow = $this->server->api->entity->add($selfEntity->level, ENTITY_OBJECT, OBJECT_ARROW, $d);
$arrow->shotByEntity = true;
$arrow->shooterEID = $selfEntity->eid;
$posY = ($target->y + $target->getEyeHeight() - 0.1);
$posY = ($selfEntity->y + $selfEntity->getEyeHeight() - 0.1);
$diffX = $target->x - $selfEntity->x;
$diffY = ($target->boundingBox->minY + ($target->height / 3)) - $posY;
$diffZ = $target->z - $selfEntity->z;