mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Player: Added animation to missSwing() (#5942)
This commit is contained in:
parent
6086ef667c
commit
bbdcab7277
@ -1897,13 +1897,14 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
|
||||
/**
|
||||
* Performs actions associated with the attack action (left-click) without a target entity.
|
||||
* Under normal circumstances, this will play the no-damage attack sound and nothing else.
|
||||
* Under normal circumstances, this will just play the no-damage attack sound and the arm-swing animation.
|
||||
*/
|
||||
public function missSwing() : void{
|
||||
$ev = new PlayerMissedSwingEvent($this);
|
||||
$ev->call();
|
||||
if(!$ev->isCancelled()){
|
||||
$this->broadcastSound(new EntityAttackNoDamageSound());
|
||||
$this->broadcastAnimation(new ArmSwingAnimation($this), $this->getViewers());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user