Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prismarine-realms

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prismarine-realms

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

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

API

Definitions

ParamTypeDescription
realmIdstringThe ID of the Realm
realmInviteCodestringThe invite code for the Realm (Only on Bedrock)
usernamestringThe username of player
uuidstringThe unique ID of the player, without hyphens
xuidstringThe Xbox User ID of the targeted player

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

const authflow = new Authflow()

const api = RealmAPI.from(authflow, 'bedrock')
getRealms(): Promise<Realm[]>

Returns a list of Realms the authenticating account has joined or owns.

await api.getRealms()
getRealm(realmId: string): Promise

Gets detailed information about a Realm if owned

await api.getRealm('1234567')
getRealmFromInvite(realmInviteCode: string): Promise

(Bedrock Edition Only) Gets detailed information about a Realm from the invite code

await api.getRealmFromInvite('AB1CD2EFA3B') // https://realms.gg/AB1CD2EFA3B will work as well
getAddress(): Promise<{ host, port }>

Gets the address for the Realm.

const realm = await api.getRealm('1234567')

await realm.getAddress()
invitePlayer(uuid: string, name: string): Promise

Invites a player to the Realm

const realm = await api.getRealm('1234567')

await realm.invitePlayer('a8005260a332457097a50bdbe48a9a21', 'Steve')
open(): Promise

Opens a Realm. Allows players to join

const realm = await api.getRealm('1234567')

await realm.open()
close(): Promise

Closes a Realm. Removes all current players and restricts joining

const realm = await api.getRealm('1234567')

await realm.close()

Keywords

FAQs

Package last updated on 04 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc