mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
added knockback for players
This commit is contained in:
parent
48cf686a2f
commit
731dd8c7df
1 changed files with 5 additions and 0 deletions
|
|
@ -1251,6 +1251,11 @@ class Entity extends Position
|
|||
}
|
||||
// attackedAtYaw = (float)((Math.atan2($d1, $d) * 180D) / 3.1415927410125732D) >
|
||||
$this->knockBack($d, $d1);
|
||||
if($this->isPlayer()){
|
||||
$pk = new SetEntityMotionPacket();
|
||||
$pk->entities = [[0, $this->speedX, $this->speedY, $this->speedZ]];
|
||||
$this->player->directDataPacket($pk, 0);
|
||||
}
|
||||
$this->knockbackTime = 10;
|
||||
$this->sendMotion();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue