minecraft

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ErrMinecraftHandshakeTimeout  greet.ErrorCode = "handshake_timeout"
	ErrMinecraftHandshakeFailed   greet.ErrorCode = "handshake_failed"
	ErrMinecraftMalformedResponse greet.ErrorCode = "malformed_response"
)
View Source
const (
	VarIntSegmentBits = 0x7F
	VarIntContinueBit = 0x80
)

VarInt encoding constants.

View Source
const DefaultMinecraftPort = 25565

DefaultMinecraftPort is the well-known port for Minecraft Java Edition.

View Source
const HandshakePacketID = 0x00

Handshake packet ID is always 0x00.

View Source
const NextStateStatus = 1

NextStateStatus is the next-state value for status queries.

View Source
const ProtocolName = "minecraft"

ProtocolName is the registered name for the Minecraft protocol.

View Source
const StatusRequestPacketID = 0x00

StatusRequestPacketID is always 0x00 (empty payload).

Variables

This section is empty.

Functions

This section is empty.

Types

type Minecraft

type Minecraft struct{}

Minecraft implements a Minecraft Java Edition status probe. It is stateless — all configuration is passed via GreetOption.

func New added in v1.0.3

func New() *Minecraft

New creates a new Minecraft application layer.

func (*Minecraft) BaseTransport added in v1.0.3

func (m *Minecraft) BaseTransport() greet.Transport

func (*Minecraft) DefaultPort

func (m *Minecraft) DefaultPort() int

func (*Minecraft) Description

func (m *Minecraft) Description() string

func (*Minecraft) Handshake added in v1.0.3

func (m *Minecraft) Handshake(ctx context.Context, start time.Time, conn net.Conn, host string, port int, cfg *greet.GreetConfig) (net.Conn, greet.LayerData, greet.LayerTiming, error)

func (*Minecraft) Name

func (m *Minecraft) Name() string

type MinecraftConfig

type MinecraftConfig struct {
	ProtocolVersion int // e.g. 775 for 26.1
}

MinecraftConfig holds protocol-specific configuration for Minecraft.

func (*MinecraftConfig) LayerConfigName added in v1.0.3

func (c *MinecraftConfig) LayerConfigName() string

type MinecraftResult

type MinecraftResult struct {
	Version    string
	MOTD       string
	Players    int
	MaxPlayers int
}

MinecraftResult holds the outcome of a Minecraft status query.

func (*MinecraftResult) LayerDataName added in v1.0.3

func (r *MinecraftResult) LayerDataName() string

Jump to

Keyboard shortcuts

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