Git Product home page Git Product logo

mcproxy's Introduction

mcproxy

A wrapper for mineflayer able to generate packets for actual minecraft clients to connect to

This project includes a working proxy server that manages the Proxy-Connections with its own ingame command set

Contribution

This Project is based on the PrismarineJS project and inspired by the 2bored2wait project, but completely seperate, which is why it isn't a fork. If you want to contribute, the project is written in TypeScript and of course OpenSource so either tinker with it yourself or if you have ideas, open an issue

ProxyServer Easy setup

have the dependent program: nodejs (and npm)

download the project with git

git clone github.com/Rob9315/mcproxy.git

or the raw zip

then open a terminal in your folder and run

npm start

to start the proxy server.

connect with your preferred minecraft client to

localhost:25566

and use the appropriate commands via the ingame chat

API

The API exposes two objects to other programs. One is the Conn() class to build your own proxy /proxy management system on top and the other is the ProxyServer() class to deploy this Proxy Server with your own configuration.

Conn

new Conn(botOptions, relayExcludedPacketNames?)

you can instantiate the Conn to deploy a new Bot to connect to a server. it takes mineflayer's botOptions and a list of packets to exclude sending, in the integrated ProxyServer this is the chat and the keep_alive packet. they are not sent to the server if received.

.bot

is the mineflayer Bot integrated into the proxy

.pclient

this should written to, as there is a method to change this attribute. it is the proxyClient that is being relayed every packet

.excludedPacketNames

the array one can set at creation of the conn object, can be changed at runtime

.sendPackets()

.sendPackets(pclient)

this method generates packets to recreate the current gamestate and sends them to the proxyClient specified

.generatePackets()

.generatePackets():Packet[]

returns the generated packets of the current gamestate

.link()

.link(pclient)

this method stops the internal bot from sending any packets to the server and starts relaying all packets to the proxyClient as well as relaying packets from the proxyClient.

.unlink()

.unlink(pclient)

this method removes links by the .link() method and cleans up afterwards

.writeIf()

.writeIf(name, data)

this is an internal method for filtering Packets, can be used outside but is mostly not necessary

ProxyServer

new ProxyServer(proxyServerOptions);

ProxyServer is the complete Proxy Management Server Class included with demo options in this repo. It is built on top on a normal minecraft-protocol Server but takes the serverOptions directly as constructor input. The ProxyServer works autonomously, methods are still exposed if required can be tinkered with but generally shouldn't.

mcproxy's People

Contributors

etiaro avatar mrgeorgen avatar rob9315 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.