Phpcraft
Public Member Functions | Public Attributes | List of all members
Phpcraft\Packet\EntityPacket Class Reference
Inheritance diagram for Phpcraft\Packet\EntityPacket:
Inheritance graph
[legend]
Collaboration diagram for Phpcraft\Packet\EntityPacket:
Collaboration graph
[legend]

Public Member Functions

 __construct ($eids=[])
 
 replaceEntity (GMP $old_eid, GMP $new_eid)
 
- Public Member Functions inherited from Phpcraft\Packet\Packet
 send (Connection $con)
 
 __toString ()
 

Public Attributes

 $eids
 

Additional Inherited Members

- Static Public Member Functions inherited from Phpcraft\Packet\Packet
static read (Connection $con)
 

Detailed Description

A clientbound packet affecting one or more entities.

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Packet\EntityPacket::__construct (   $eids = [])
Parameters
array<GMP>|GMP|int|string$eids A single entity ID or an array of entity IDs.

Member Function Documentation

◆ replaceEntity()

Phpcraft\Packet\EntityPacket::replaceEntity ( GMP  $old_eid,
GMP  $new_eid 
)

Replaces an entity ID in the packet, e.g. for a proxy where the downstream and upstream entity IDs for the player differ.

Parameters
GMP$old_eid
GMP$new_eid
Returns
void

Member Data Documentation

◆ $eids

array< GMP > Phpcraft\Packet\EntityPacket::$eids

The entities' IDs. When using Packet::read(), this will only ever have one entity ID, except for DestroyEntityPacket.