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

Public Member Functions

 __construct ($eid=0, EntityType $type=null, UUID $uuid=null)
 
 send (Connection $con)
 
 __toString ()
 

Static Public Member Functions

static read (Connection $con)
 

Public Attributes

 $eid
 
 $uuid
 
 $type
 
 $pos
 
 $yaw = 0
 
 $pitch = 0
 
 $metadata
 

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Packet\SpawnMobPacket::__construct (   $eid = 0,
EntityType  $type = null,
UUID  $uuid = null 
)
Parameters
GMP | int | string$eidThe entity ID of the mob.
EntityType | null$typeThe type of mob.
UUID | null$uuidThe UUID of the entity.

Member Function Documentation

◆ __toString()

Phpcraft\Packet\SpawnMobPacket::__toString ( )

Reimplemented from Phpcraft\Packet\Packet.

◆ read()

static Phpcraft\Packet\SpawnMobPacket::read ( Connection  $con)
static

Initialises the packet class by reading its payload from the given Connection.

Parameters
Connection$con
Returns
SpawnMobPacket
Exceptions
IOException

Reimplemented from Phpcraft\Packet\Packet.

◆ send()

Phpcraft\Packet\SpawnMobPacket::send ( Connection  $con)

Adds the packet's ID and payload to the Connection's write buffer and sends it over the wire if the connection has a stream. Note that in some cases this will produce multiple Minecraft packets, therefore you should only use this on connections without a stream if you know what you're doing.

Parameters
Connection$con
Returns
void
Exceptions
IOException

Reimplemented from Phpcraft\Packet\Packet.

Member Data Documentation

◆ $eid

GMP Phpcraft\Packet\SpawnMobPacket::$eid

The entity ID of the mob.

◆ $metadata

Metadata Phpcraft\Packet\SpawnMobPacket::$metadata

The entity metadata of the mob.

◆ $pitch

float Phpcraft\Packet\SpawnMobPacket::$pitch = 0

The mob's rotation on the Y axis, -90 to 90.

◆ $pos

Point3D Phpcraft\Packet\SpawnMobPacket::$pos

The position of the mob.

◆ $type

EntityType Phpcraft\Packet\SpawnMobPacket::$type

The type of mob.

◆ $uuid

UUID Phpcraft\Packet\SpawnMobPacket::$uuid

The UUID of the entity.

◆ $yaw

float Phpcraft\Packet\SpawnMobPacket::$yaw = 0

The mob's rotation on the X axis, 0 to 359.9.