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

Public Member Functions

 send (Connection $con)
 
 __toString ()
 
- Public Member Functions inherited from Phpcraft\Packet\BossBar\BossBarPacket
 __construct (?UUID $uuid=null)
 

Public Attributes

 $title
 
 $health = 1.0
 
 $color = 0
 
 $division = 0
 
 $darken_sky = false
 
 $play_end_music = false
 
 $create_fog = false
 
- Public Attributes inherited from Phpcraft\Packet\BossBar\BossBarPacket
const COLOR_PINK = 0
 
const COLOR_BLUE = 1
 
const COLOR_RED = 2
 
const COLOR_GREEN = 3
 
const COLOR_YELLOW = 4
 
const COLOR_PURPLE = 5
 
const COLOR_WHITE = 6
 
const DIVISION_0 = 0
 
const DIVISION_6 = 1
 
const DIVISION_10 = 2
 
const DIVISION_12 = 3
 
const DIVISION_20 = 4
 
 $uuid
 

Additional Inherited Members

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

Member Function Documentation

◆ __toString()

Phpcraft\Packet\BossBar\AddBossBarPacket::__toString ( )

Reimplemented from Phpcraft\Packet\Packet.

◆ send()

Phpcraft\Packet\BossBar\AddBossBarPacket::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

◆ $color

int Phpcraft\Packet\BossBar\AddBossBarPacket::$color = 0

The color of the boss bar.

See also
BossBarPacket

◆ $create_fog

boolean Phpcraft\Packet\BossBar\AddBossBarPacket::$create_fog = false

True if this should create fog.

◆ $darken_sky

boolean Phpcraft\Packet\BossBar\AddBossBarPacket::$darken_sky = false

True if the sky should be darkened.

◆ $division

int Phpcraft\Packet\BossBar\AddBossBarPacket::$division = 0

The division of the boss bar.

See also
BossBarPacket

◆ $health

float Phpcraft\Packet\BossBar\AddBossBarPacket::$health = 1.0

The percentage the boss bar is filled, aka. the health of the boss. This should be between 0 and 1. And whilst values below 0 disconnect the client, values above 1 render additional boss bars to the right.

◆ $play_end_music

boolean Phpcraft\Packet\BossBar\AddBossBarPacket::$play_end_music = false

True if this should play the end music.

◆ $title

ChatComponent Phpcraft\Packet\BossBar\AddBossBarPacket::$title

The "title" of the boss bar.