https://github.com/g07cha/mineflayerautoauth
Micro module for mineflayer bot that interacts with server's chat auth
https://github.com/g07cha/mineflayerautoauth
authorization minecraft mineflayer-bot
Last synced: 11 months ago
JSON representation
Micro module for mineflayer bot that interacts with server's chat auth
- Host: GitHub
- URL: https://github.com/g07cha/mineflayerautoauth
- Owner: G07cha
- License: mit
- Created: 2016-02-07T06:07:37.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T20:21:00.000Z (over 3 years ago)
- Last Synced: 2025-03-27T02:11:17.046Z (about 1 year ago)
- Topics: authorization, minecraft, mineflayer-bot
- Language: JavaScript
- Size: 94.7 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AutoAuth
Minecraft bot auth in servers that don't use `online-mode=true` and require chat authentication. After extending bot will send auth data on `/register` and `/login` messages in chat and emit `serverAuth` event after that. Extends [mineflayer](https://github.com/PrismarineJS/mineflayer).
[**You can find migration guide from 0.x to 1.x here**](/MIGRATION.md)
## Install
### As dependency
`npm install mineflayer-auto-auth`
Also make sure that `mineflayer` installed locally as well.
### As development version
```
git clone https://github.com/G07cha/MineflayerAutoAuth
npm install
npm test
```
## Usage
Simple example:
```javascript
var mineflayer = require('mineflayer');
var AutoAuth = require('mineflayer-auto-auth')
var bot = mineflayer.createBot({
plugins: [AutoAuth],
AutoAuth: 'password'
});
bot.on('serverAuth', function() {
// Here bot should be already authorized
});
```
Advanced usage(see [API](#api):
```javascript
var mineflayer = require('mineflayer');
var AutoAuth = require('mineflayer-auto-auth')
var bot = mineflayer.createBot({
plugins: [AutoAuth],
AutoAuth: {
logging: true,
password: 'password',
ignoreRepeat: true
}
});
bot.on('serverAuth', function() {
// Here bot should be already authorized
});
```
## API
- AutoAuth as string is shorthand for `AutoAuth: { password: 'yourpassword' }`
### `AutoAuth` object
- password(required)
- logging(default: false) - additional logging for easier debug
- ignoreRepeat(default: false) - ignore repeating login/register requests, by default will log about repeating
- repeatCb(function) - callback called on request repeating
## License
MIT © [Konstantin Azizov](http://g07cha.github.io)