mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +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) >
|
// attackedAtYaw = (float)((Math.atan2($d1, $d) * 180D) / 3.1415927410125732D) >
|
||||||
$this->knockBack($d, $d1);
|
$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->knockbackTime = 10;
|
||||||
$this->sendMotion();
|
$this->sendMotion();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue