Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Monster can't attack creative(spectator) player #303

Merged
merged 4 commits into from May 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/revivalpmmp/pureentities/entity/monster/FlyingMonster.php
Expand Up @@ -126,6 +126,9 @@ public function onUpdate(int $currentTick) : bool{
$this->entityBaseTick($tickDiff);

$target = $this->updateMove($tickDiff);
if($player instanceof Player && !$player->isSurvival()) {
return true;
}
if($target instanceof Player){
$this->attackEntity($target);
}elseif(
Expand Down
Expand Up @@ -126,6 +126,9 @@ public function onUpdate(int $currentTick) : bool{
$this->entityBaseTick($tickDiff);

$target = $this->updateMove($tickDiff);
if($player instanceof Player && !$player->isSurvival()) {
return true;
}
if($this->isFriendly()){
if(!($target instanceof Player)){
if($target instanceof Entity){
Expand Down
Expand Up @@ -126,6 +126,9 @@ public function onUpdate(int $currentTick) : bool{
$this->entityBaseTick($tickDiff);

$target = $this->updateMove($tickDiff);
if($player instanceof Player && !$player->isSurvival()) {
return true;
}
if($this->isFriendly()){
if(!($target instanceof Player)){
if($target instanceof Entity){
Expand Down
Expand Up @@ -69,6 +69,9 @@ public function checkAndAttackEntity(Entity $player){
return;
}
}
if(!$player->isSurvival()) {
return;
}
$this->attackEntity($player);
}

Expand Down