Add support for basic entity picking via middle-click (#5397)

Support for more advanced stuff like NBT copying wasn't added in this PR, as the NBT used by PM is currently an inconsistent mess and doesn't play nice with vanilla. In the interests of avoiding this mess propagating, it's been left for another time.

Adds PlayerEntityPickEvent a la PlayerBlockPickEvent
and Entity->getPickedItem().
This commit is contained in:
Javier León
2024-11-15 18:27:10 -03:00
committed by GitHub
parent ff695a5f97
commit d3add78d3e
10 changed files with 142 additions and 19 deletions

View File

@ -671,7 +671,7 @@ class InGamePacketHandler extends PacketHandler{
}
public function handleActorPickRequest(ActorPickRequestPacket $packet) : bool{
return false; //TODO
return $this->player->pickEntity($packet->actorUniqueId);
}
public function handlePlayerAction(PlayerActionPacket $packet) : bool{