🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

mcpc-server

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mcpc-server

Minecraft Java Edition server tool to run servers with CLI and API

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
0
Created
Source

mcpc-server

NPM version Build Status Discord Try it on gitpod

Command line program (CLI) and API for starting and working with Minecraft Java Edition servers.

Running & Installation

Start a server through the command line:

npx mcpc-server -v 1.18

Or with npm to use programmatically:

npm install mcpc-server

Usage

via command line

npx mcpc-server --help
npx mcpc-server --version 1.18 --online --path ./my1.18server

any extraneous -- options will be placed inside the server.properties file, e.g. --level-name coolWorld.

via code

see index.d.ts

const mcpcServer = require('mcpc-server')

const onStart = () => console.log('Server started!')

mcpcServer.startServer('1.18.0', onStart, { 'server-port': 25565, 'online-mode': true, path: './bds' })

Get latest server data

From minecraft.net downloads

mcpcServer.getLatestVersions().then(console.log)

to get

[
  [ '1.21.4', 'release', '2024-12-03T10:24:48+00:00' ],
  [ '1.21.4-pre1', 'snapshot', '2024-12-03T10:00:03+00:00' ],
  [ '24w46a', 'snapshot', '2024-12-03T10:00:03+00:00' ],
  ...
  [ '1.21.2', 'release', '2024-12-03T06:33:45+00:00' ],
  [ '24w40a', 'snapshot', '2024-12-03T06:33:45+00:00' ]
]

Help screen

mcpc-server - v1.0.0
Minecraft Java Edition Server runner
Usage:
  mcpc-server --version latest      Start a server on the latest version
  mcpc-server --versions            List all avaliable versions
  mcpc-server -v 1.20 --download    Download v1.20

Options:
  --version, -v Version to download (use "latest" for latest)  
  --port        Port to listen on for IPv4  (default: 25565)
  --online      Whether to run in online mode  
  --path        Custom path to the server directory  
  --versions    Passing --versions will list all versions  
  --dumpRegistries      Run all data generators and output to the passed path  
  --download    Download (but not run) the server binary 

API

See the exported TypeScript defs for method docs.

Testing

npm test

History

See history

Keywords

prismarine

FAQs

Package last updated on 06 Jan 2025

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