Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

prismarine-realms

PrismarineJS35.1kMIT1.3.2TypeScript support: included

Library to manage and interact with Minecraft Realms for Java/Bedrock edition

prismarine, realms

readme

prismarine-realms

NPM version Build Status Discord Try it on gitpod

Minecraft Realm interface for Minecraft Java and Bedrock editions, providing a stable API to start/stop Realms, and obtain Realm information such as connection addresses.

Minecraft Realms is a subscription based service provided by Mojang where users can host, create and manage their own private Minecraft servers.

Installation

npm install prismarine-realms

Usage

RealmAPI

.from(authflow: Authflow, platform: 'bedrock' | 'java')

Takes an Authflow instance from prismarine-auth, you can see the documentation for this here.

Example

const { Authflow } = require('prismarine-auth') 
const { RealmAPI } = require('prismarine-realms')

const authflow = new Authflow()

const api = RealmAPI.from(authflow, 'bedrock') // or 'java'

// Returns a list of Realms the authenticating account has joined or owns.
await api.getRealms().then(console.log)

Documentation

See API Documentation

changelog

History

1.3.2

  • Retry 5xx errors with exponential backoff (@LucienHH)

1.3.1

  • Use fs.promises over fs/promises (@extremeheat)

1.3.0

  • import Authflow into index.d.ts (@jojomatik) #35
  • Add Realm backup & world download endpoints (@LucienHH) #30
  • Move docs to API.md (@LucienHH) #24

1.2.0

  • Fix typo in index.d.ts
  • Add invite endpoints

1.1.1

  • Fix missing debug dependency
  • Retry 5 times for pc realm address endpoint

1.1.0

  • Add getRealmFromInvite endpoint
  • Add retry for server errors and getAddress return host/port
  • Update doc and platform type handling

1.0.0

  • initial implementation