packet

package
v0.0.0-...-d78c878 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotImplemented = errors.New("a packet field has not been implemented")

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Name      string
	Signature []byte
}

type BlockUpdate

type BlockUpdate struct {
	Location types.Position
	BlockID  int32
}

func (*BlockUpdate) Decode

func (c *BlockUpdate) Decode(r *encoding.Reader) error

func (BlockUpdate) Encode

func (c BlockUpdate) Encode(w *encoding.Writer) error

func (BlockUpdate) ID

func (c BlockUpdate) ID() int32

type BundleDelimiter

type BundleDelimiter struct{}

func (BundleDelimiter) Decode

func (b BundleDelimiter) Decode(r *encoding.Reader) error

func (BundleDelimiter) Encode

func (b BundleDelimiter) Encode(w *encoding.Writer) error

func (BundleDelimiter) ID

func (b BundleDelimiter) ID() int32

type ChangeDifficulty

type ChangeDifficulty struct {
	Difficulty       uint8
	DifficultyLocked bool
}

func (*ChangeDifficulty) Decode

func (m *ChangeDifficulty) Decode(r *encoding.Reader) error

func (ChangeDifficulty) Encode

func (m ChangeDifficulty) Encode(w *encoding.Writer) error

func (ChangeDifficulty) ID

func (m ChangeDifficulty) ID() int32

type ChatCommandServer

type ChatCommandServer struct {
	Command              string
	Timestamp            int64
	Salt                 int64
	ArgumentSignatures   []Argument
	AcknowledgedMessages []int64
}

func (*ChatCommandServer) Decode

func (m *ChatCommandServer) Decode(r *encoding.Reader) error

func (ChatCommandServer) Encode

func (m ChatCommandServer) Encode(w *encoding.Writer) error

func (ChatCommandServer) ID

func (m ChatCommandServer) ID() int32

type ChatMessageServer

type ChatMessageServer struct {
	Message              string
	Timestamp            int64
	Salt                 int64
	Signature            []byte
	AcknowledgedMessages []int64
}

func (*ChatMessageServer) Decode

func (m *ChatMessageServer) Decode(r *encoding.Reader) error

func (ChatMessageServer) Encode

func (m ChatMessageServer) Encode(w *encoding.Writer) error

func (ChatMessageServer) ID

func (m ChatMessageServer) ID() int32

type ChunkData

type ChunkData struct {
	X, Z int32

	//Data includes height-map, section data, block entities
	// and light information.
	Data []byte
}

func (*ChunkData) Decode

func (d *ChunkData) Decode(r *encoding.Reader) error

func (*ChunkData) Encode

func (d *ChunkData) Encode(w *encoding.Writer) error

func (ChunkData) ID

func (d ChunkData) ID() int32

type ClickContainer

type ClickContainer struct {
	WindowID    uint8
	StateID     int32
	Slot        int16
	Button      int8
	Mode        int32
	Slots       map[int16]Slot
	CarriedItem Slot
}

func (*ClickContainer) Decode

func (c *ClickContainer) Decode(r *encoding.Reader) error

func (ClickContainer) Encode

func (c ClickContainer) Encode(w *encoding.Writer) error

func (ClickContainer) ID

func (c ClickContainer) ID() int32

type ClientCommandServer

type ClientCommandServer struct {
	ActionID int32
}

func (*ClientCommandServer) Decode

func (m *ClientCommandServer) Decode(r *encoding.Reader) error

func (ClientCommandServer) Encode

func (ClientCommandServer) ID

func (m ClientCommandServer) ID() int32

type ClientSettings

type ClientSettings struct {
	Locale               string
	ViewDistance         int8
	ChatMode             int32
	ChatColors           bool
	DisplayedSkinParts   uint8
	MainHand             int32
	DisableTextFiltering bool
	AllowServerListings  bool
}

func (*ClientSettings) Decode

func (s *ClientSettings) Decode(r *encoding.Reader) error

func (ClientSettings) Encode

func (s ClientSettings) Encode(w *encoding.Writer) error

func (ClientSettings) ID

func (s ClientSettings) ID() int32

type CombatDeath

type CombatDeath struct {
	PlayerID int32
	Message  string
}

func (*CombatDeath) Decode

func (c *CombatDeath) Decode(r *encoding.Reader) error

func (CombatDeath) Encode

func (c CombatDeath) Encode(w *encoding.Writer) error

func (CombatDeath) ID

func (c CombatDeath) ID() int32

type CommandSuggestionsRequest

type CommandSuggestionsRequest struct {
	TransactionId int32
	Text          string
}

func (*CommandSuggestionsRequest) Decode

func (CommandSuggestionsRequest) Encode

func (CommandSuggestionsRequest) ID

type CommandSuggestionsResponse

type CommandSuggestionsResponse struct {
	TransactionId int32
	Start         int32
	Length        int32
	Matches       []SuggestionMatch
}

func (*CommandSuggestionsResponse) Decode

func (CommandSuggestionsResponse) Encode

func (CommandSuggestionsResponse) ID

type ConfigurationClientboundPluginMessage

type ConfigurationClientboundPluginMessage struct {
	Channel string
	Data    []byte
}

func (ConfigurationClientboundPluginMessage) Decode

func (ConfigurationClientboundPluginMessage) Encode

func (ConfigurationClientboundPluginMessage) ID

type DamageEvent

type DamageEvent struct {
	EntityID       int32
	SourceTypeID   int32
	SourceCauseID  int32
	SourceDirectID int32

	HasSrcPos bool
	X, Y, Z   float64
}

func (*DamageEvent) Decode

func (l *DamageEvent) Decode(r *encoding.Reader) error

func (DamageEvent) Encode

func (l DamageEvent) Encode(w *encoding.Writer) error

func (DamageEvent) ID

func (l DamageEvent) ID() int32

type DeclareCommands

type DeclareCommands struct {
	Nodes []types.CommandNode

	RootIndex int32
}

func (*DeclareCommands) Decode

func (d *DeclareCommands) Decode(r *encoding.Reader) error

func (*DeclareCommands) Encode

func (d *DeclareCommands) Encode(w *encoding.Writer) error

func (*DeclareCommands) ID

func (d *DeclareCommands) ID() int32

type DeleteMessage

type DeleteMessage struct {
	MessageID int32
	Signature []byte
}

func (*DeleteMessage) Decode

func (m *DeleteMessage) Decode(r *encoding.Reader) error

func (DeleteMessage) Encode

func (m DeleteMessage) Encode(w *encoding.Writer) error

func (DeleteMessage) ID

func (m DeleteMessage) ID() int32

type DestroyEntities

type DestroyEntities struct {
	EntityIds []int32
}

func (*DestroyEntities) Decode

func (d *DestroyEntities) Decode(r *encoding.Reader) error

func (DestroyEntities) Encode

func (d DestroyEntities) Encode(w *encoding.Writer) error

func (DestroyEntities) ID

func (d DestroyEntities) ID() int32

type DisconnectLogin

type DisconnectLogin struct {
	Reason chat.Message
}

func (*DisconnectLogin) Decode

func (l *DisconnectLogin) Decode(r *encoding.Reader) error

func (DisconnectLogin) Encode

func (l DisconnectLogin) Encode(w *encoding.Writer) error

func (DisconnectLogin) ID

func (l DisconnectLogin) ID() int32

type DisconnectPlay

type DisconnectPlay struct {
	DisconnectLogin
}

func (DisconnectPlay) ID

func (p DisconnectPlay) ID() int32

type DisguisedChatMessage

type DisguisedChatMessage struct {
	Message      chat.Message
	ChatType     int32
	ChatTypeName chat.Message
	TargetName   *chat.Message
}

func (*DisguisedChatMessage) Decode

func (m *DisguisedChatMessage) Decode(r *encoding.Reader) error

func (DisguisedChatMessage) Encode

func (DisguisedChatMessage) ID

func (m DisguisedChatMessage) ID() int32

type Enchantment

type Enchantment struct {
	Id    string `nbt:"id"`
	Level int16  `nbt:"lvl"`
}

type EncryptionRequest

type EncryptionRequest struct {
	ServerID    string
	PublicKey   []byte
	VerifyToken []byte
}

func (*EncryptionRequest) Decode

func (r *EncryptionRequest) Decode(rd *encoding.Reader) error

func (EncryptionRequest) Encode

func (r EncryptionRequest) Encode(w *encoding.Writer) error

func (EncryptionRequest) ID

func (r EncryptionRequest) ID() int32

type EncryptionRequest121

type EncryptionRequest121 struct {
	*EncryptionRequest
	ShouldAuthenticate bool
}

func (*EncryptionRequest121) Decode

func (r *EncryptionRequest121) Decode(rd *encoding.Reader) error

func (EncryptionRequest121) Encode

type EncryptionResponse

type EncryptionResponse struct {
	SharedSecret []byte
	VerifyToken  []byte
}

func (*EncryptionResponse) Decode

func (e *EncryptionResponse) Decode(r *encoding.Reader) error

func (EncryptionResponse) Encode

func (e EncryptionResponse) Encode(w *encoding.Writer) error

func (EncryptionResponse) ID

func (e EncryptionResponse) ID() int32

type EntityAnimation

type EntityAnimation struct {
	EntityID  int32
	Animation uint8
}

func (*EntityAnimation) Decode

func (a *EntityAnimation) Decode(r *encoding.Reader) error

func (EntityAnimation) Encode

func (a EntityAnimation) Encode(w *encoding.Writer) error

func (EntityAnimation) ID

func (a EntityAnimation) ID() int32

type EntityEvent

type EntityEvent struct {
	EntityID int32
	Status   int8
}

func (*EntityEvent) Decode

func (c *EntityEvent) Decode(r *encoding.Reader) error

func (EntityEvent) Encode

func (c EntityEvent) Encode(w *encoding.Writer) error

func (EntityEvent) ID

func (c EntityEvent) ID() int32

type EntityHeadRotation

type EntityHeadRotation struct {
	EntityID int32
	HeadYaw  uint8
}

func (*EntityHeadRotation) Decode

func (l *EntityHeadRotation) Decode(r *encoding.Reader) error

func (EntityHeadRotation) Encode

func (l EntityHeadRotation) Encode(w *encoding.Writer) error

func (EntityHeadRotation) ID

func (l EntityHeadRotation) ID() int32

type EntityPosition

type EntityPosition struct {
	EntityID int32
	X, Y, Z  int16
	OnGround bool
}

func (*EntityPosition) Decode

func (p *EntityPosition) Decode(r *encoding.Reader) error

func (EntityPosition) Encode

func (p EntityPosition) Encode(w *encoding.Writer) error

func (EntityPosition) ID

func (p EntityPosition) ID() int32

type EntityPositionRotation

type EntityPositionRotation struct {
	EntityID   int32
	X, Y, Z    int16
	Yaw, Pitch byte
	OnGround   bool
}

func (*EntityPositionRotation) Decode

func (EntityPositionRotation) Encode

func (EntityPositionRotation) ID

type EntityRotation

type EntityRotation struct {
	EntityID   int32
	Yaw, Pitch uint8
	OnGround   bool
}

func (*EntityRotation) Decode

func (r *EntityRotation) Decode(rd *encoding.Reader) error

func (EntityRotation) Encode

func (r EntityRotation) Encode(w *encoding.Writer) error

func (EntityRotation) ID

func (r EntityRotation) ID() int32

type EntitySoundEffect

type EntitySoundEffect struct {
	SoundID       int32
	SoundName     string
	HasRange      bool
	Range         float32
	Category      int32
	EntityID      int32
	Volume, Pitch float32
	Seed          int64
}

func (*EntitySoundEffect) Decode

func (c *EntitySoundEffect) Decode(r *encoding.Reader) error

func (EntitySoundEffect) Encode

func (c EntitySoundEffect) Encode(w *encoding.Writer) error

func (EntitySoundEffect) ID

func (c EntitySoundEffect) ID() int32

type Explosion

type Explosion struct {
	X, Y, Z       float32
	Strength      float32
	Records       []byte
	PlayerMotionX float32
	PlayerMotionY float32
	PlayerMotionZ float32
}

func (*Explosion) Decode

func (e *Explosion) Decode(r *encoding.Reader) error

func (*Explosion) Encode

func (e *Explosion) Encode(w *encoding.Writer) error

func (*Explosion) ID

func (e *Explosion) ID() int32

type GameEvent

type GameEvent struct {
	Event uint8
	Value float32
}

func (*GameEvent) Decode

func (m *GameEvent) Decode(r *encoding.Reader) error

func (GameEvent) Encode

func (m GameEvent) Encode(w *encoding.Writer) error

func (GameEvent) ID

func (m GameEvent) ID() int32

type Handshake

type Handshake struct {
	ProtocolVersion int32

	ServerAddress string

	ServerPort uint16

	NextState uint8
}

func (*Handshake) Decode

func (h *Handshake) Decode(r *encoding.Reader) error

func (Handshake) Encode

func (h Handshake) Encode(w *encoding.Writer) error

func (Handshake) ID

func (h Handshake) ID() int32

type HeldItemChange

type HeldItemChange struct {
	Slot int16
}

func (*HeldItemChange) Decode

func (c *HeldItemChange) Decode(r *encoding.Reader) error

func (*HeldItemChange) Encode

func (c *HeldItemChange) Encode(w *encoding.Writer) error

func (*HeldItemChange) ID

func (c *HeldItemChange) ID() int32

type HurtAnimation

type HurtAnimation struct {
	EntityID int32
	Yaw      float32
}

func (*HurtAnimation) Decode

func (l *HurtAnimation) Decode(r *encoding.Reader) error

func (HurtAnimation) Encode

func (l HurtAnimation) Encode(w *encoding.Writer) error

func (HurtAnimation) ID

func (l HurtAnimation) ID() int32

type InteractServer

type InteractServer struct {
	EntityID int32
	Type     int32
	TargetX  float32
	TargetY  float32
	TargetZ  float32
	Hand     int32
	Sneaking bool
}

func (*InteractServer) Decode

func (p *InteractServer) Decode(r *encoding.Reader) error

func (InteractServer) Encode

func (p InteractServer) Encode(w *encoding.Writer) error

func (InteractServer) ID

func (p InteractServer) ID() int32

type JoinGame

type JoinGame struct {
	EntityID         int32
	IsHardcore       bool
	GameMode         uint8
	PreviousGameMode int8
	DimensionNames   []string

	Registry []byte

	DimensionType       string
	DimensionName       string
	HashedSeed          int64
	MaxPlayers          int32
	ViewDistance        int32
	SimulationDistance  int32
	ReducedDebugInfo    bool
	EnableRespawnScreen bool
	IsDebug             bool
	IsFlat              bool
	DeathDimensionName  string
	DeathLocation       uint64
	PartialCooldown     int32
}

func (*JoinGame) Decode

func (g *JoinGame) Decode(r *encoding.Reader) error

func (JoinGame) Encode

func (g JoinGame) Encode(w *encoding.Writer) error

func (JoinGame) ID

func (g JoinGame) ID() int32

type KeepAliveClient

type KeepAliveClient struct {
	PayloadID int64
}

func (*KeepAliveClient) Decode

func (a *KeepAliveClient) Decode(r *encoding.Reader) error

func (*KeepAliveClient) Encode

func (a *KeepAliveClient) Encode(w *encoding.Writer) error

func (*KeepAliveClient) ID

func (a *KeepAliveClient) ID() int32

type KeepAliveServer

type KeepAliveServer struct {
	PayloadID int64
}

func (*KeepAliveServer) Decode

func (a *KeepAliveServer) Decode(r *encoding.Reader) error

func (*KeepAliveServer) Encode

func (a *KeepAliveServer) Encode(w *encoding.Writer) error

func (*KeepAliveServer) ID

func (a *KeepAliveServer) ID() int32

type LoginStart

type LoginStart struct {
	Name string
	UUID [16]byte
}

func (*LoginStart) Decode

func (s *LoginStart) Decode(r *encoding.Reader) error

func (LoginStart) Encode

func (s LoginStart) Encode(w *encoding.Writer) error

func (LoginStart) ID

func (s LoginStart) ID() int32

type LoginSuccess

type LoginSuccess struct {
	UUID [16]byte
	Name string

	Properties []types.Property
}

func (*LoginSuccess) Decode

func (s *LoginSuccess) Decode(r *encoding.Reader) error

func (LoginSuccess) Encode

func (s LoginSuccess) Encode(w *encoding.Writer) error

func (LoginSuccess) ID

func (s LoginSuccess) ID() int32

type LoginSuccess121

type LoginSuccess121 struct {
	*LoginSuccess

	StrictErrorHandling bool
}

func (*LoginSuccess121) Decode

func (l *LoginSuccess121) Decode(r *encoding.Reader) error

func (*LoginSuccess121) Encode

func (l *LoginSuccess121) Encode(w *encoding.Writer) error

type MessageAcknowledgment

type MessageAcknowledgment struct {
	MessageCount int32
}

func (*MessageAcknowledgment) Decode

func (MessageAcknowledgment) Encode

func (MessageAcknowledgment) ID

type Packet

type Packet interface {
	ID() int32

	Decode(r *encoding.Reader) error

	Encode(w *encoding.Writer) error
}

type PaddleBoat

type PaddleBoat struct {
	LeftPaddleTurning  bool
	RightPaddleTurning bool
}

func (*PaddleBoat) Decode

func (p *PaddleBoat) Decode(r *encoding.Reader) error

func (*PaddleBoat) Encode

func (p *PaddleBoat) Encode(w *encoding.Writer) error

func (PaddleBoat) ID

func (p PaddleBoat) ID() int32

type Particle

type Particle struct {
	ParticleID                int32
	LongDistance              bool
	X, Y, Z                   float64
	OffsetX, OffsetY, OffsetZ float32
	ParticleData              float32
	ParticleCount             int32
	Data                      bool //varies
}

func (*Particle) Decode

func (p *Particle) Decode(r *encoding.Reader) error

func (*Particle) Encode

func (p *Particle) Encode(w *encoding.Writer) error

func (*Particle) ID

func (p *Particle) ID() int32

type Ping

type Ping struct {
	Payload int64
}

func (*Ping) Decode

func (p *Ping) Decode(r *encoding.Reader) error

func (Ping) Encode

func (p Ping) Encode(w *encoding.Writer) error

func (Ping) ID

func (p Ping) ID() int32

type PlayClientboundPluginMessage

type PlayClientboundPluginMessage struct {
	Channel string
	Data    []byte
}

func (PlayClientboundPluginMessage) Decode

func (PlayClientboundPluginMessage) Encode

func (PlayClientboundPluginMessage) ID

type PlayerAbilities

type PlayerAbilities struct {
	Flags               byte
	FlyingSpeed         float32
	FieldOfViewModifier float32
}

func (*PlayerAbilities) Decode

func (p *PlayerAbilities) Decode(r *encoding.Reader) error

func (PlayerAbilities) Encode

func (p PlayerAbilities) Encode(w *encoding.Writer) error

func (PlayerAbilities) ID

func (p PlayerAbilities) ID() int32

type PlayerAbilitiesServer

type PlayerAbilitiesServer struct {
	Flags byte
}

func (*PlayerAbilitiesServer) Decode

func (PlayerAbilitiesServer) Encode

func (PlayerAbilitiesServer) ID

type PlayerActionServer

type PlayerActionServer struct {
	Status   int32
	Location types.Position
	Face     int8
	Sequence int32
}

func (*PlayerActionServer) Decode

func (m *PlayerActionServer) Decode(r *encoding.Reader) error

func (PlayerActionServer) Encode

func (m PlayerActionServer) Encode(w *encoding.Writer) error

func (PlayerActionServer) ID

func (m PlayerActionServer) ID() int32

type PlayerChatMessage

type PlayerChatMessage struct {
	//Header
	Sender           [16]byte
	Index            int32
	MessageSignature []byte
	//Body
	Message   string
	Timestamp int64
	Salt      int64
	//Previous Messages
	PreviousMessages []PreviousMessage
	//Other
	UnsignedContent *chat.Message
	FilterType      int32
	FilterTypeBits  []int64
	//Network Target
	ChatType          int32
	NetworkName       chat.Message
	NetworkTargetName *chat.Message
}

func (*PlayerChatMessage) Decode

func (m *PlayerChatMessage) Decode(r *encoding.Reader) error

func (PlayerChatMessage) Encode

func (m PlayerChatMessage) Encode(w *encoding.Writer) error

func (PlayerChatMessage) ID

func (m PlayerChatMessage) ID() int32

type PlayerCommandServer

type PlayerCommandServer struct {
	EntityID  int32
	ActionID  int32
	JumpBoost int32
}

func (*PlayerCommandServer) Decode

func (m *PlayerCommandServer) Decode(r *encoding.Reader) error

func (PlayerCommandServer) Encode

func (PlayerCommandServer) ID

func (m PlayerCommandServer) ID() int32

type PlayerInfoRemove

type PlayerInfoRemove struct {
	UUIDs [][16]byte
}

func (PlayerInfoRemove) Decode

func (p PlayerInfoRemove) Decode(r *encoding.Reader) error

func (PlayerInfoRemove) Encode

func (p PlayerInfoRemove) Encode(w *encoding.Writer) error

func (PlayerInfoRemove) ID

func (p PlayerInfoRemove) ID() int32

type PlayerInfoUpdate

type PlayerInfoUpdate struct {
	Actions byte
	Players []types.PlayerInfo
}

func (*PlayerInfoUpdate) Decode

func (i *PlayerInfoUpdate) Decode(r *encoding.Reader) error

func (*PlayerInfoUpdate) Encode

func (i *PlayerInfoUpdate) Encode(w *encoding.Writer) error

func (*PlayerInfoUpdate) ID

func (i *PlayerInfoUpdate) ID() int32

type PlayerMovement

type PlayerMovement struct {
	OnGround bool
}

func (*PlayerMovement) Decode

func (m *PlayerMovement) Decode(r *encoding.Reader) error

func (PlayerMovement) Encode

func (m PlayerMovement) Encode(w *encoding.Writer) error

func (PlayerMovement) ID

func (m PlayerMovement) ID() int32

type PlayerPosition

type PlayerPosition struct {
	X, FeetY, Z float64

	OnGround bool
}

func (*PlayerPosition) Decode

func (p *PlayerPosition) Decode(r *encoding.Reader) error

func (PlayerPosition) Encode

func (p PlayerPosition) Encode(w *encoding.Writer) error

func (PlayerPosition) ID

func (p PlayerPosition) ID() int32

type PlayerPositionRotation

type PlayerPositionRotation struct {
	X, FeetY, Z float64

	Yaw, Pitch float32

	OnGround bool
}

func (*PlayerPositionRotation) Decode

func (PlayerPositionRotation) Encode

func (PlayerPositionRotation) ID

type PlayerRotation

type PlayerRotation struct {
	Yaw, Pitch float32

	OnGround bool
}

func (*PlayerRotation) Decode

func (r *PlayerRotation) Decode(rd *encoding.Reader) error

func (PlayerRotation) Encode

func (r PlayerRotation) Encode(w *encoding.Writer) error

func (PlayerRotation) ID

func (r PlayerRotation) ID() int32

type PlayerSessionServer

type PlayerSessionServer struct {
	SessionID    [16]byte
	ExpiresAt    int64
	PublicKey    []byte
	KeySignature []byte
}

func (*PlayerSessionServer) Decode

func (m *PlayerSessionServer) Decode(r *encoding.Reader) error

func (PlayerSessionServer) Encode

func (PlayerSessionServer) ID

func (m PlayerSessionServer) ID() int32

type Pong

type Pong struct {
	Payload int64
}

func (*Pong) Decode

func (p *Pong) Decode(r *encoding.Reader) error

func (Pong) Encode

func (p Pong) Encode(w *encoding.Writer) error

func (Pong) ID

func (p Pong) ID() int32

type PreviousMessage

type PreviousMessage struct {
	MessageID int32
	Signature []byte
}

type Request

type Request struct{}

func (Request) Decode

func (r Request) Decode(rd *encoding.Reader) error

func (Request) Encode

func (r Request) Encode(w *encoding.Writer) error

func (Request) ID

func (r Request) ID() int32

type ResourcePack

type ResourcePack struct {
	URL    string
	Hash   string
	Forced bool
	Prompt *chat.Message
}

func (*ResourcePack) Decode

func (c *ResourcePack) Decode(r *encoding.Reader) error

func (ResourcePack) Encode

func (c ResourcePack) Encode(w *encoding.Writer) error

func (ResourcePack) ID

func (c ResourcePack) ID() int32

type ResourcePackResult

type ResourcePackResult struct {
	Result int32
}

func (*ResourcePackResult) Decode

func (m *ResourcePackResult) Decode(r *encoding.Reader) error

func (ResourcePackResult) Encode

func (m ResourcePackResult) Encode(w *encoding.Writer) error

func (ResourcePackResult) ID

func (m ResourcePackResult) ID() int32

type Respawn

type Respawn struct {
	DimensionType      string
	DimensionName      string
	HashedSeed         int64
	GameMode           uint8
	PreviousGameMode   int8
	IsDebug            bool
	IsFlat             bool
	DataKept           uint8
	DeathDimensionName string
	DeathLocation      uint64
	PartialCooldown    int32
}

func (*Respawn) Decode

func (g *Respawn) Decode(r *encoding.Reader) error

func (Respawn) Encode

func (g Respawn) Encode(w *encoding.Writer) error

func (Respawn) ID

func (g Respawn) ID() int32

type Response

type Response struct {
	JSON []byte
}

func (*Response) Decode

func (r *Response) Decode(rd *encoding.Reader) error

func (Response) Encode

func (r Response) Encode(w *encoding.Writer) error

func (Response) ID

func (r Response) ID() int32

type ServerData

type ServerData struct {
	MOTD               chat.Message
	Icon               []byte
	EnforcesSecureChat bool
}

func (*ServerData) Decode

func (m *ServerData) Decode(r *encoding.Reader) error

func (ServerData) Encode

func (m ServerData) Encode(w *encoding.Writer) error

func (ServerData) ID

func (m ServerData) ID() int32

type SetBlockDestroyStage

type SetBlockDestroyStage struct {
	EntityID     int32
	Location     types.Position
	DestroyStage byte
}

func (*SetBlockDestroyStage) Decode

func (c *SetBlockDestroyStage) Decode(r *encoding.Reader) error

func (SetBlockDestroyStage) Encode

func (SetBlockDestroyStage) ID

func (c SetBlockDestroyStage) ID() int32

type SetCenterChunk

type SetCenterChunk struct {
	ChunkX int32
	ChunkZ int32
}

func (*SetCenterChunk) Decode

func (p *SetCenterChunk) Decode(r *encoding.Reader) error

func (SetCenterChunk) Encode

func (p SetCenterChunk) Encode(w *encoding.Writer) error

func (SetCenterChunk) ID

func (p SetCenterChunk) ID() int32

type SetCompression

type SetCompression struct {
	Threshold int32
}

func (*SetCompression) Decode

func (s *SetCompression) Decode(r *encoding.Reader) error

func (SetCompression) Encode

func (s SetCompression) Encode(w *encoding.Writer) error

func (SetCompression) ID

func (s SetCompression) ID() int32

type SetContainerContent

type SetContainerContent struct {
	WindowID uint8
	StateID  int32
	Slots    []Slot
}

func (*SetContainerContent) Decode

func (m *SetContainerContent) Decode(r *encoding.Reader) error

func (SetContainerContent) Encode

func (SetContainerContent) ID

func (m SetContainerContent) ID() int32

type SetContainerSlot

type SetContainerSlot struct {
	WindowID int8
	StateID  int32
	Slot     int16
	Data     Slot
}

func (*SetContainerSlot) Decode

func (s *SetContainerSlot) Decode(r *encoding.Reader) error

func (SetContainerSlot) Encode

func (s SetContainerSlot) Encode(w *encoding.Writer) error

func (*SetContainerSlot) ID

func (s *SetContainerSlot) ID() int32

type SetCreativeModeSlot

type SetCreativeModeSlot struct {
	Slot        int16
	ClickedItem Slot
}

func (*SetCreativeModeSlot) Decode

func (c *SetCreativeModeSlot) Decode(r *encoding.Reader) error

func (SetCreativeModeSlot) Encode

func (SetCreativeModeSlot) ID

func (c SetCreativeModeSlot) ID() int32

type SetDefaultSpawnPosition

type SetDefaultSpawnPosition struct {
	Location types.Position
	Angle    float32
}

func (SetDefaultSpawnPosition) Decode

func (SetDefaultSpawnPosition) Encode

func (SetDefaultSpawnPosition) ID

type SetEntityMetadata

type SetEntityMetadata struct {
	EntityID int32
	MetaData metadata.MetaData
}

func (*SetEntityMetadata) Decode

func (s *SetEntityMetadata) Decode(r *encoding.Reader) error

func (SetEntityMetadata) Encode

func (s SetEntityMetadata) Encode(w *encoding.Writer) error

func (*SetEntityMetadata) ID

func (*SetEntityMetadata) ID() int32

type SetEntityVelocity

type SetEntityVelocity struct {
	EntityID int32
	X, Y, Z  int16
}

func (*SetEntityVelocity) Decode

func (p *SetEntityVelocity) Decode(r *encoding.Reader) error

func (SetEntityVelocity) Encode

func (p SetEntityVelocity) Encode(w *encoding.Writer) error

func (SetEntityVelocity) ID

func (p SetEntityVelocity) ID() int32

type SetEquipment

type SetEquipment struct {
	EntityID int32
	Slot     int8
	Item     Slot
}

func (*SetEquipment) Decode

func (m *SetEquipment) Decode(r *encoding.Reader) error

func (SetEquipment) Encode

func (m SetEquipment) Encode(w *encoding.Writer) error

func (SetEquipment) ID

func (m SetEquipment) ID() int32

type SetHealth

type SetHealth struct {
	Health         float32
	Food           int32
	FoodSaturation float32
}

func (*SetHealth) Decode

func (h *SetHealth) Decode(r *encoding.Reader) error

func (SetHealth) Encode

func (h SetHealth) Encode(w *encoding.Writer) error

func (SetHealth) ID

func (h SetHealth) ID() int32

type SetHeldItem

type SetHeldItem struct {
	Slot int8
}

func (*SetHeldItem) Decode

func (m *SetHeldItem) Decode(r *encoding.Reader) error

func (SetHeldItem) Encode

func (m SetHeldItem) Encode(w *encoding.Writer) error

func (SetHeldItem) ID

func (m SetHeldItem) ID() int32

type SetHeldItemServer

type SetHeldItemServer struct {
	Slot int16
}

func (*SetHeldItemServer) Decode

func (m *SetHeldItemServer) Decode(r *encoding.Reader) error

func (SetHeldItemServer) Encode

func (m SetHeldItemServer) Encode(w *encoding.Writer) error

func (SetHeldItemServer) ID

func (m SetHeldItemServer) ID() int32

type SetTablistHeaderFooter

type SetTablistHeaderFooter struct {
	Header string
	Footer string
}

func (*SetTablistHeaderFooter) Decode

func (SetTablistHeaderFooter) Encode

func (SetTablistHeaderFooter) ID

type Slot

type Slot struct {
	Present bool
	Count   int8
	Id      int32
	Tag     SlotTag
}

type SlotTag

type SlotTag struct {
	Damage       int32         `nbt:"Damage"`
	RepairCost   int32         `nbt:"RepairCost"`
	Enchantments []Enchantment `nbt:"Enchantments"`
}

type SoundEffect

type SoundEffect struct {
	SoundId       int32
	SoundCategory int32
	X, Y, Z       int32
	Volume, Pitch float32
}

func (*SoundEffect) Decode

func (e *SoundEffect) Decode(r *encoding.Reader) error

func (SoundEffect) Encode

func (e SoundEffect) Encode(w *encoding.Writer) error

func (*SoundEffect) ID

func (e *SoundEffect) ID() int32

type SpawnEntity

type SpawnEntity struct {
	EntityID                        int32
	UUID                            [16]byte
	Type                            int32
	X, Y, Z                         float64
	Pitch, Yaw, HeadYaw             byte
	Data                            int32
	VelocityX, VelocityY, VelocityZ int16
}

func (*SpawnEntity) Decode

func (e *SpawnEntity) Decode(r *encoding.Reader) error

func (*SpawnEntity) Encode

func (e *SpawnEntity) Encode(w *encoding.Writer) error

func (*SpawnEntity) ID

func (e *SpawnEntity) ID() int32

type SpawnPlayer

type SpawnPlayer struct {
	EntityID   int32
	PlayerUUID [16]byte
	X, Y, Z    float64
	Yaw, Pitch byte
}

func (*SpawnPlayer) Decode

func (p *SpawnPlayer) Decode(r *encoding.Reader) error

func (SpawnPlayer) Encode

func (p SpawnPlayer) Encode(w *encoding.Writer) error

func (SpawnPlayer) ID

func (p SpawnPlayer) ID() int32

type SuggestionMatch

type SuggestionMatch struct {
	Match   string
	Tooltip string
}

type SwingArmServer

type SwingArmServer struct {
	Hand int32
}

func (*SwingArmServer) Decode

func (s *SwingArmServer) Decode(r *encoding.Reader) error

func (SwingArmServer) Encode

func (s SwingArmServer) Encode(w *encoding.Writer) error

func (SwingArmServer) ID

func (s SwingArmServer) ID() int32

type SyncPlayerPos

type SyncPlayerPos struct {
	X, Y, Z    float64
	Yaw, Pitch float32
	Flags      int8
	TeleportID int32
}

SyncPlayerPos updates the player's position on the client's side.

func (*SyncPlayerPos) Decode

func (l *SyncPlayerPos) Decode(r *encoding.Reader) error

func (SyncPlayerPos) Encode

func (l SyncPlayerPos) Encode(w *encoding.Writer) error

func (*SyncPlayerPos) ID

func (l *SyncPlayerPos) ID() int32

type SystemChatMessage

type SystemChatMessage struct {
	Message chat.Message
}

func (*SystemChatMessage) Decode

func (m *SystemChatMessage) Decode(r *encoding.Reader) error

func (SystemChatMessage) Encode

func (m SystemChatMessage) Encode(w *encoding.Writer) error

func (SystemChatMessage) ID

func (m SystemChatMessage) ID() int32

type Tag

type Tag struct {
	Name    string
	Entries []int32
}

type TagType

type TagType struct {
	Type string
	Tags []Tag
}

type TeleportConfirm

type TeleportConfirm struct {
	TeleportID int32
}

func (*TeleportConfirm) Decode

func (t *TeleportConfirm) Decode(r *encoding.Reader) error

func (TeleportConfirm) Encode

func (t TeleportConfirm) Encode(w *encoding.Writer) error

func (TeleportConfirm) ID

func (t TeleportConfirm) ID() int32

type TeleportEntity

type TeleportEntity struct {
	EntityID   int32
	X, Y, Z    float64
	Yaw, Pitch byte
	OnGround   bool
}

func (*TeleportEntity) Decode

func (r *TeleportEntity) Decode(rd *encoding.Reader) error

func (TeleportEntity) Encode

func (r TeleportEntity) Encode(w *encoding.Writer) error

func (TeleportEntity) ID

func (r TeleportEntity) ID() int32

type TeleportToEntityServer

type TeleportToEntityServer struct {
	Player [16]byte
}

func (*TeleportToEntityServer) Decode

func (TeleportToEntityServer) Encode

func (TeleportToEntityServer) ID

type TestPacket

type TestPacket struct {
	Boolean       bool
	Byte          int8
	UnsignedByte  uint8
	Short         int16
	UnsignedShort uint16
	Int           int32
	Long          int64
	Float         float32
	Double        float64
	String        string

	VarInt  int32
	VarLong int64

	UUID [16]byte

	ByteArray []uint8
}

TestPacket is a packet which holds every possible data type which can be received or sent to the client

func (*TestPacket) Decode

func (t *TestPacket) Decode(r *encoding.Reader) error

func (*TestPacket) Encode

func (t *TestPacket) Encode(w *encoding.Writer) error

func (*TestPacket) ID

func (t *TestPacket) ID() int32

type Unknown

type Unknown struct {
	Id      int32
	Payload []byte
}

func (Unknown) Decode

func (u Unknown) Decode(*encoding.Reader) error

func (Unknown) Encode

func (u Unknown) Encode(w *encoding.Writer) error

func (Unknown) ID

func (u Unknown) ID() int32

type UnloadChunk

type UnloadChunk struct {
	ChunkX, ChunkZ int32
}

func (*UnloadChunk) Decode

func (c *UnloadChunk) Decode(r *encoding.Reader) error

func (UnloadChunk) Encode

func (c UnloadChunk) Encode(w *encoding.Writer) error

func (UnloadChunk) ID

func (c UnloadChunk) ID() int32

type UpdateTags

type UpdateTags struct {
	Tags []TagType
}

func (*UpdateTags) Decode

func (s *UpdateTags) Decode(r *encoding.Reader) error

func (UpdateTags) Encode

func (s UpdateTags) Encode(w *encoding.Writer) error

func (*UpdateTags) ID

func (*UpdateTags) ID() int32

type UpdateTime

type UpdateTime struct {
	WorldAge  int64
	TimeOfDay int64
}

func (*UpdateTime) Decode

func (c *UpdateTime) Decode(r *encoding.Reader) error

func (UpdateTime) Encode

func (c UpdateTime) Encode(w *encoding.Writer) error

func (UpdateTime) ID

func (c UpdateTime) ID() int32

type UseItem

type UseItem struct {
	Hand int32
}

func (*UseItem) Decode

func (i *UseItem) Decode(r *encoding.Reader) error

func (*UseItem) Encode

func (i *UseItem) Encode(w *encoding.Writer) error

func (*UseItem) ID

func (i *UseItem) ID() int32

type UseItemOnServer

type UseItemOnServer struct {
	Hand                                              int32
	Location                                          types.Position
	Face                                              int32
	CursorPositionX, CursorPositionY, CursorPositionZ float32
	InsideBlock                                       bool
	Sequence                                          int32
}

func (*UseItemOnServer) Decode

func (m *UseItemOnServer) Decode(r *encoding.Reader) error

func (UseItemOnServer) Encode

func (m UseItemOnServer) Encode(w *encoding.Writer) error

func (UseItemOnServer) ID

func (m UseItemOnServer) ID() int32

type WorldEvent

type WorldEvent struct {
	Event                 int32
	Location              types.Position
	Data                  int32
	DisableRelativeVolume bool
}

func (*WorldEvent) Decode

func (c *WorldEvent) Decode(r *encoding.Reader) error

func (WorldEvent) Encode

func (c WorldEvent) Encode(w *encoding.Writer) error

func (WorldEvent) ID

func (c WorldEvent) ID() int32

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL