component

package
v0.0.0-...-abfa450 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatComponent

type ChatComponent struct {
	Bold          bool             `json:"bold,omitempty"`
	Italic        bool             `json:"italic,omitempty"`
	Underlined    bool             `json:"underlined,omitempty"`
	StrikeThrough bool             `json:"strikethrough,omitempty"`
	Obfuscated    bool             `json:"obfuscated,omitempty"`
	Color         *string          `json:"color,omitempty"`
	Insertion     *string          `json:"insertion,omitempty"`
	ClickEvent    *ClickAction     `json:"clickEvent,omitempty"`
	HoverEvent    *HoverAction     `json:"hoverEvent,omitempty"`
	Extra         []IChatComponent `json:"extra,omitempty"`
}

func (*ChatComponent) AddExtra

func (component *ChatComponent) AddExtra(extra IChatComponent)

func (*ChatComponent) JSON

func (component *ChatComponent) JSON() (string, error)

func (*ChatComponent) SetBold

func (component *ChatComponent) SetBold(bold bool)

func (*ChatComponent) SetClickEvent

func (component *ChatComponent) SetClickEvent(action *ClickAction)

func (*ChatComponent) SetColor

func (component *ChatComponent) SetColor(color chat.Color)

func (*ChatComponent) SetExtra

func (component *ChatComponent) SetExtra(extra []IChatComponent)

func (*ChatComponent) SetHoverEvent

func (component *ChatComponent) SetHoverEvent(action *HoverAction)

func (*ChatComponent) SetInsertion

func (component *ChatComponent) SetInsertion(insertion string)

func (*ChatComponent) SetItalic

func (component *ChatComponent) SetItalic(italic bool)

func (*ChatComponent) SetObfuscated

func (component *ChatComponent) SetObfuscated(obfuscated bool)

func (*ChatComponent) SetStrikeThrough

func (component *ChatComponent) SetStrikeThrough(strikeThrough bool)

func (*ChatComponent) SetUnderlined

func (component *ChatComponent) SetUnderlined(underlined bool)

type ClickAction

type ClickAction struct {
	Action string      `json:"action"`
	Value  interface{} `json:"value"`
}

func ClickChangePage

func ClickChangePage(page uint) *ClickAction

Only for Books

func ClickOpenFile

func ClickOpenFile(file string) *ClickAction

Wont work most likely

func ClickOpenURL

func ClickOpenURL(url string) *ClickAction

func ClickRunCommand

func ClickRunCommand(command string) *ClickAction

func ClickSuggestCommand

func ClickSuggestCommand(command string) *ClickAction

type HoverAction

type HoverAction struct {
	Action string      `json:"action"`
	Value  interface{} `json:"value"`
}

func HoverEntity

func HoverEntity(enttiyJson string) *HoverAction

func HoverItem

func HoverItem(itemjson string) *HoverAction

func HoverText

func HoverText(components []IChatComponent) *HoverAction

type IChatComponent

type IChatComponent interface {
	JSON() (string, error)
}

type StringChatComponent

type StringChatComponent struct {
	Text string `json:"text"`
	*ChatComponent
}

func ChatMessage

func ChatMessage(text string) *StringChatComponent

func (*StringChatComponent) JSON

func (component *StringChatComponent) JSON() (string, error)

func (*StringChatComponent) SetText

func (component *StringChatComponent) SetText(text string)

Jump to

Keyboard shortcuts

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