class

Rosegold::Clientbound::SpawnEntity

Inherits Rosegold::Packets::ProtocolMapping / Rosegold::Clientbound::Packet / Rosegold::Packet / Rosegold::Event / Reference / Object

Constants

ENTITY_TYPE_PLAYER_BY_PROTOCOL = {772_u32 => 149_u32, 774_u32 => 155_u32, 775_u32 => 155_u32}
PROTOCOL_PACKET_IDS = {772_u32 => 1_u32, 774_u32 => 1_u32, 775_u32 => 1_u32}

Store the protocol mappings as a constant

Constructors

new(entity_id : UInt64, uuid : UUID, entity_type : UInt32, x : Float64, y : Float64, z : Float64, pitch : Float64, yaw : Float64, head_yaw : Float64, data : UInt32, velocity_x : Float64, velocity_y : Float64, velocity_z : Float64)
Source

Class methods

[](protocol_version : UInt32) : UInt32

Generate the method for elegant access

Source
default_packet_id

Define default packet ID (typically the latest/most common version)

Source
entity_type_player
Source
packet_id

Provide backward compatibility with existing packet_id class getter Use the first protocol's packet ID for registration compatibility

packet_id_for_protocol(protocol_version : UInt32) : UInt32

Get packet ID for specific protocol version (returns UInt32 for VarInt encoding in write methods)

Source
read(packet)
Source
state
Source
supported_protocols

Helper method to get all supported protocols

Source
supports_protocol?(protocol_version : UInt32) : Bool

Helper method to check if a protocol is supported

Source

Instance methods

callback(client)
Source
data
Source
data=(data : UInt32)
Source
entity_id
Source
entity_id=(entity_id : UInt64)
Source
entity_type
Source
entity_type=(entity_type : UInt32)
Source
head_yaw
Source
head_yaw=(head_yaw : Float64)
Source
pitch
Source
pitch=(pitch : Float64)
Source
uuid
Source
uuid=(uuid : UUID)
Source
velocity_x
Source
velocity_x=(velocity_x : Float64)
Source
velocity_y
Source
velocity_y=(velocity_y : Float64)
Source
velocity_z
Source
velocity_z=(velocity_z : Float64)
Source
write
Source
x=(x : Float64)
Source
y=(y : Float64)
Source
yaw=(yaw : Float64)
Source
z=(z : Float64)
Source