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

prismarine-proxy

v1.1.4

Published

Provide features to build proxies using Prismarine modules

Downloads

26

Readme

prismarine-proxy

NPM version Build Status Discord

Provide features to build proxies using Prismarine modules

Roadmap

Provide features to build low and high level proxies, see https://github.com/PrismarineJS/node-minecraft-protocol/issues/712 for details.

Example of use case :

  • client side proxies :
    • make yourself a bot : do pathfinding like a bot, auto dig things, ...
    • share your world view with a friend using prismarine-viewer
  • server side proxies :
    • act as a proxy with many vanilla client servers, with portals or commands to switch
    • change things in server behavior : forbid going to some places, change the blocks, ...

The idea for this repo is for people to add example, and piece by piece build a lib that make sense for various use cases, while trying to use and improve mineflayer, flying-squid and the prismarine components.

Usage

InstantConnectProxy

This is a proxy that will allow you to instantly connect to the target, so you won't be able to send packets to the client before or after the client connects to the target server. This proxy only allows clients to connect to one server.

Usage

const { InstantConnectProxy } = require('prismarine-proxy')

const login = ['[email protected]', 'mypassword']

const proxy = new InstantConnectProxy({
  loginHandler: (client) => { // client object has a username object, so you can store usernames with their respective logins
    return { username: login[0], password: login[1] } // the login the proxy will connect to the server with
  },
  serverOptions: { // options for the local server shown to the vanilla client
    version: '1.8.9'
  },
  clientOptions: { // options for the client that will connect to the proxied server
    version: '1.8.9',
    host: 'hypixel.net' // server the proxy will connect to
  }
})

proxy.on('incoming', (data, meta, toClient, toServer) => { // packets incoming from the server to the client
  if (meta.name === 'world_particles') return // for 1.8.9, world_particles is the packet that contains particles, so by returning here, the client connected to the proxy won't get any particles
  toClient.write(meta.name, data) // otherwise send the packet to the client
})

proxy.on('outgoing', (data, meta, toClient, toServer) => { // packets outgoing from the client to the server
  if (meta.name === 'chat') console.log(data.message) // for 1.8.9, chat is the packet that the client sends to send a chat message to the server, so by using console.log, we can sniff the message before it hits the server, and even return early so it wouldn't hit the server
  toServer.write(meta.name, data) // otherwise send the packet to the client
})

The name of the particles can be found here , make sure to select the version you are playing on at the top then click protocol, more info about packets can be found here , make sure to select the version you are working with