High level Minecraft proxy with Node.js API. Creates a mineflayer bot that acts as a proxy at the same time. Works with 1.12.2 (and 1.18.2 soon TM)
- Install git
- Install yarn (npm may not work)
- Run
yarn add mineflayer-proxy-inspector
to add it to your project
- World persistance (World is loaded from the bots memory when joining)
- Real time packet interception and editing
- 'Spactator' mode. See the bot running around as a fake player.
- Multi player support. Can give control off the connection to any connected client.
Makes a new Inspector Proxy class.
botOptions
- Mineflayer bot options for the bot that will be created. Specify the host and port you want to make the proxy join here.proxyOptions
port
Optional. Defaults to 25566. Port the proxy server will run on. When joining with the proxy join this port.motd
Optional. Motd to set for the proxy server.security
Optional. ObjectonlineMode
Optional. Defaults tofalse
. Check incoming accounts for online mode.allowList
Optional. Array off strings with allowed player names. Or a callback that takes a name and returns a boolean value. If not set all players are allowed to join.kickMessage
Optional. String to set as the kicked message if player is not allowed to join.
linkOnConnect
Optional. Defaults totrue
. Automatically link connecting clients to the bot or not.autoStartBotOnServerLogin
Optional. Defaults totrue
. Automatically start the bot if not started when someone tries to connect to the proxy server.botAutoStart
Optional. Defaults totrue
. Auto start the bot on Class instantiation.botStopOnLogoff
Optional. Defaults totrue
. Auto stop the bot when the last user disconnects from the proxy.serverAutoStart
Optional. Defaults totrue
. Auto start the server on Class instantiation.serverStopOnBotStop
Optional. Defaults tofalse
. Auto stop the server when the bot disconnects.logPlayerJoinLeave
Optional. Defaults tofalse
. Logs when players join or leave the proxy.disconnectAllOnEnd
Optional. Defaults totrue
. Logs off all connected proxy connections when the bot disconnects.disabledCommands
Optional. Defaults tofalse
. Disables all in game commands.toClientMiddlewares
Optional. Array off additional middlewares to register for each client's packets going from server to client.toServerMiddlewares
Optional. Array off additional middlewares to register for each client's packets going from client to server.worldCaching
Optional. Defaults totrue
. Iffalse
deactivates world caching.
Returns true when no client is currently controlling the proxy
Starts the bot with botOptions
options
Returns
- A promise that resolves when the bot is ready.
Stops the bot
Stops the proxy server
Starts the proxy server with proxyOptions
options
Send a message to a given client
client
- The client to send the message tomessage
. String message to send to clientsprefix
Optional. Defaults totrue
. Display the proxy message prefixproxyChatPrefix
before messages.allowFormatting
Optional. Defaults totrue
. Allow formatting characters in the message (for instance§e §3
)position
Optional. Defaults to0
(chat). Number position to display the text in. Can be0
1
or2
Sends a message to all connected clients
message
. String message to send to clientsprefix
Optional. Defaults totrue
. Display the proxy message prefixproxyChatPrefix
before messages.allowFormatting
Optional. Defaults totrue
. Allow formatting characters in the message (for instance§e §3
)position
Optional. Defaults to0
(chat). Number position to display the text in. Can be0
1
or2
Prints the build in commands to the given client as chat messages
client
- The client to send the messages to
Attach a specific client to the proxy. This makes the client receive packets send by the server. This is done internally automatically and should not be used unless you know what you are doing.
client
- The client to connect to
Links the given client into the current connection. This makes this client control the bot and the connection until it is unlinked again or disconnects.
client
- The client
Opposite of link
client
- Optional. The client to unlink.
Send packets needed to synchronize a newly connected client with the world state to the proxy. This is done automatically and should not be used unless you know what you are doing.
client
- The client to send packets to
Looks a clients view into the view off the bot. Only works when the client is not controlling the bot. Does nothing otherwise.
returns
- A boolean value if a client has been looked into a view or not
Reset the effects off makeViewFakePlayer
returns
- A boolean value if the view off the client has been changed or not.
Set the motd message for the proxy server.
line1
- String. Line one off the motd messageline2
- Optional. Defaults to an empty string. Line two off the motd message
Set the motd message as a chat message element
message
- Instance ofprismarine-chat
. The ChatMessage instance to set as the motd.
Sends a message to a given client. Works the same as {InspectorProxy}.sendMessage
but can be used to send messages to any client instance.
Make a new bot with bot options like mineflayer's createBot function. Automatically creates the proxy server once the bot has joined a game.
Returns
- A mcproxyConn
instance. Has the underlying bot instance asConn.bot
accessible. This can be used to program the bot like any other mineflayer bot.options
- An Object containing mineflayer's bot options.proxyOptions
- Optional. An Object containing the proxy Options.port
- Optional, defaults to25566
. The port the proxy server should run on. Is used when joining the bots world with your client (Ie. connect tolocalhost:<port>
).motd
- Optional. The motd on the proxy server.