title

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package title provides functionality for showing Minecraft titles for players.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTitle

func ClearTitle(viewer Viewer) error

ClearTitle clears the title of the viewer.

func HideTitle

func HideTitle(viewer Viewer) error

HideTitle hides the title from the viewer.

func ShowTitle

func ShowTitle(viewer Viewer, opts *Options) error

ShowTitle shows a title to the viewer.

Types

type Options

type Options struct {
	Title                 component.Component
	Subtitle              component.Component
	FadeIn, Stay, FadeOut time.Duration
	// The parts of a title to update exclusively.
	// If empty, all parts are being updated.
	Parts []Part
}

Options for showing a title.

type Part

type Part byte

Part is a part of a title.

const (
	TitlePart    Part = iota + 1 // Update title
	SubtitlePart                 // Update subtitle
	TimesPart                    // Update title times
)

type Viewer

type Viewer interface {
	netmc.PacketWriter
}

Viewer is the interface for a title viewer (e.g. a player).

Jump to

Keyboard shortcuts

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