interact event fixed

This commit is contained in:
GameHerobrine 2022-11-10 10:51:09 +03:00
parent 6bc20a0a02
commit 834bb3d486
2 changed files with 9 additions and 6 deletions

View file

@ -1794,7 +1794,11 @@ class Player{
$this->toCraft = [];
$target = $this->server->api->entity->get($packet->target);
if($target instanceof Entity and $this->entity instanceof Entity and $this->gamemode !== VIEW and $this->blocked === false and ($target instanceof Entity) and $this->entity->distance($target) <= 8){
$target->interactWith($this->entity, $packet->action);
$data["targetentity"] = $packet->target;
$data["entity"] = $this;
if($this->server->handle("player.interact", $data) !== false){
$target->interactWith($this->entity, $packet->action);
}
}
break;
@ -2385,4 +2389,4 @@ class PlayerNull extends Player{
public function __construct(){
}
}
}