v1.16.5-pre2.0...-5b980bd Latest Latest

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 8 Imported by: 0





This section is empty.


View Source
var Domain = ""

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


This section is empty.


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
var r *Realms

r = New(

servers, err := r.Worlds()
if err != nil {

for _, v := range servers {
	fmt.Println(v.Name, v.ID)

time.Sleep(time.Second * 5)
if err := r.TOS(); err != nil {

time.Sleep(time.Second * 5)

func New

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

New create a new Realms c 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) ([]int, 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) Invite

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

Invite 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
	RemoteSubscriptionID string
	Owner                string
	OwnerUUID            string
	Name                 string
	MOTD                 string
	State                string
	DaysLeft             int
	Expired              bool
	ExpiredTrial         bool
	WorldType            string
	Players              []string
	MaxPlayers           int
	MiniGameName         *string
	MiniGameID           *int
	MinigameImage        *string
	ActiveSlot           int
	//Slots                interface{}
	Member bool

Jump to

Keyboard shortcuts

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