npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mineflayer-viaproxy

v0.3.6

Published

ViaProxy support for mineflayer.

Downloads

68

Readme

mineflayer-viaproxy

NPM version

A mineflayer plugin that allows you to connect to a server through a ViaVersion proxy.

Why? Because I'm tired of people asking for version updates.

If you have issues, join here for support. Alternatively, here for general mineflayer support.

NOTICE

Because mineflayer currently doesn't support ViaProxy due to an error in prismarine-registry (see here), you must use the patched version of prismarine-registry.

This is the TypeError: Cannot read properties of undefined (reading 'overworld') error in plugins/game.js for mineflayer.

To do this, the fix below must be added to your JSON. It is dependent on the dependency installer you are using.:

// For npm:
"overrides": {
    "prismarine-registry": "git+https://github.com/GenerelSchwerz/prismarine-registry#mc-prefix-fix"
}
// For yarn:
"resolutions": {
    "prismarine-registry": "git+https://github.com/GenerelSchwerz/prismarine-registry#mc-prefix-fix"
}

NOTICE 2

This plugin does not work with Python due to JSPYBridge not having the ability to change the resolutions for libraries. I cannot do anything about this.

TODOS

  • [x] Support bedrock versions
  • [x] Support adding accounts to ViaProxy gracefully.
  • [ ] Make fix for prismarine-registry more robust (see patches)
  • [ ] Add support for more ViaVersion options
  • [ ] Add support for more ViaProxy options
  • [ ] Support Python

Installation

npm install mineflayer-viaproxy

Usage

const {createBot} = require('mineflayer-viaproxy')

// only difference is that this must be awaited now.
const bot = await createBot({...})

// if you want to pass viaProxy options, it'd be like so:

const orgBotOpts = {...}
const viaProxyOpts = {...}

// same object. 
const bot = await createBot({...orgBotOpts, ...viaProxyOpts});

API

Types

AuthType

enum AuthType {
    NONE,
    OPENAUTHMOD,
    ACCOUNT
}

| Name | Value | Description | |------|-------|-------------| | NONE | "NONE" | No authentication | | OPENAUTHMOD | "OPENAUTHMOD" | OpenAuthMod authentication | | ACCOUNT | "ACCOUNT" | Account authentication (requires manual setup) |

ViaProxyOpts

interface ViaProxyOpts {
    javaPath?: string;
    bedrock?: boolean;
    localPort?: number;
    localAuth?: AuthType,
    viaProxyLocation?: string;
    viaProxyWorkingDir?: string;
    autoUpdate?: boolean;
    viaProxyStdoutCb?: (data: any) => void
    viaProxyStderrCb?: (data: any) => void

}

| Name | Type | Default | Description | |------|------|---------|-------------| | javaPath | string | "java" | The path to the java executable. | | bedrock | boolean | false | Whether or not to use the bedrock version of ViaProxy. | | localPort | number | auto determined | The port to listen on for the local server. If none is specified, it will automatically locate an open port for you on your computer. | | localAuth | AuthType | AuthType.NONE | The authentication type to use for the local server | | viaProxyLocation | string | "" | The location of the ViaVersion proxy jar. If none specified, it will download automatically to the CWD + viaproxy. | | viaProxyWorkingDir | string | "" | The working directory for the ViaVersion proxy. If none specified, it will use the CWD + viaproxy. | | autoUpdate | boolean | true | Whether or not to automatically update the ViaVersion proxy. | | viaProxyStdoutCb | (data: any) => void | undefined | A callback for the stdout of the ViaVersion proxy. | | viaProxyStderrCb | (data: any) => void | undefined | A callback for the stderr of the ViaVersion proxy. |