v0.0.0-...-18e7427 Latest Latest

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 8 Imported by: 0




View Source
const Domain = ""

Domain is the URL of Realms API server Panic if it cannot be parsed by url.Parse().


This section is empty.


This section is empty.


type Backup

type Backup struct {
	ID               int   `json:"backupId"`
	LastModifiedDate int64 `json:"lastModifiedDate"`
	Size             int64 `json:"size"`
	Metadata         struct {
		Difficulty   string `json:"game_difficulty"`
		Name         string `json:"name"`
		Version      string `json:"version"`
		EnabledPacks struct {
			RessourcePacks []string `json:"resourcePacks"`
			BehaviorPacks  []string `json:"behaviorPacks"`
		Description string `json:"description"`
		Mode        string `json:"game_mode"`
		Type        string `json:"world_type"`
	} `json:"metadata"`

type Error

type Error struct {
	ErrorCode int
	ErrorMsg  string

func (*Error) Error

func (e *Error) Error() string

type Realms

type Realms struct {
	// contains filtered or unexported fields

func NewRealms

func NewRealms(version, user, astk, uuid string) *Realms

NewRealms create a new Realms with version, username, accessToken and UUID without dashes.

func (*Realms) Address

func (r *Realms) Address(s Server) (string, error)

Address used to get the IP address for a server. Call TOS before you call this function.

func (*Realms) Available

func (r *Realms) Available() (ok bool, err error)

Available returns whether the user can access the Minecraft Realms service

func (*Realms) Backups

func (r *Realms) Backups(s Server) ([]Backup, error)

Backups returns a list of backups for the world.

func (*Realms) Compatible

func (r *Realms) Compatible() (string, error)

Compatible returns whether the clients version is up-to-date with Realms.

if the client is outdated, it returns OUTDATED,
if the client is running a snapshot, it returns OTHER,
else it returns COMPATIBLE.

func (*Realms) Download

func (r *Realms) Download() (link, resURL, resHash string)

func (*Realms) Invite

func (r *Realms) Invite(s Server, name, uuid string) error

Invite player to Realm

func (*Realms) Ops

func (r *Realms) Ops(s Server) (ops []string, err error)

Ops returns a list of operators for this server. You must own this server to view this.

func (*Realms) Server

func (r *Realms) Server(ID int) (s Server, err error)

Server returns a single server listing about a server. you must be the owner of the server.

func (*Realms) SubscriptionLife

func (r *Realms) SubscriptionLife(s Server) (startDate int64, daysLeft int, Type string, err error)

SubscriptionLife returns the current life of a server subscription.

func (*Realms) TOS

func (r *Realms) TOS() error

TOS is what to join Realms servers you must agree to. Call this function will set this flag.

func (*Realms) Worlds

func (r *Realms) Worlds() ([]Server, error)

Worlds return a list of servers that the user is invited to or owns.

type Server

type Server struct {
	ID                   int      `json:"id"`
	RemoteSubscriptionID string   `json:"remoteSubscriptionId"`
	Owner                string   `json:"owner"`
	OwnerUUID            string   `json:"ownerUUID"`
	Name                 string   `json:"name"`
	MOTD                 string   `json:"motd"`
	State                string   `json:"state"`
	DaysLeft             int      `json:"daysLeft"`
	Expired              bool     `json:"expired"`
	ExpiredTrial         bool     `json:"expiredTrial"`
	WorldType            string   `json:"worldType"`
	Players              []string `json:"players"`
	MaxPlayers           int      `json:"maxPlayers"`
	MiniGameName         *string  `json:"minigameName,omitempty"`
	MiniGameID           *int     `json:"minigameId,omitempty"`
	MinigameImage        *string  `json:"minigameImage,omitempty"`
	ActiveSlot           int      `json:"activeSlot"`
	//Slots                interface{}
	Member bool `json:"member"`

Jump to

Keyboard shortcuts

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