https://github.com/pqml/prismarine-tokens
Store and re-use tokens for authentifications like the official launcher. Works both on minecraft-protocol and mineflayer
https://github.com/pqml/prismarine-tokens
Last synced: 22 days ago
JSON representation
Store and re-use tokens for authentifications like the official launcher. Works both on minecraft-protocol and mineflayer
- Host: GitHub
- URL: https://github.com/pqml/prismarine-tokens
- Owner: pqml
- License: mit
- Created: 2016-04-23T21:52:09.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-01-01T14:47:01.000Z (over 3 years ago)
- Last Synced: 2025-03-24T19:45:45.471Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 13
- Watchers: 2
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prismarine-tokens
Store and use authentication tokens instead of passwords to emulate the way the official launcher works## Features
* Store all authentications tokens to automatically reuse them on future connections
* Minimal username+password authentications to prevent Mojang from blocking your account
* Support of both mineflayer and minecraft-protocol
* Multiple storage files
* Asynchronous calls
* Easy implementation on your project: just wrap all your bot in a callback function## Installation
`npm install prismarine-tokens`
## Usage
### Example with mineflayer
```js
var mineflayer = require('mineflayer');
var tokens = require('prismarine-tokens');var options = {
host: 'localhost', // optional
port: 25565, // optional
username: '[email protected]',
password: '12345678',
//Location of the file to store and read tokens for this bot
//You can use the same file for all your bots
tokensLocation: './bot_tokens.json',
//Set to true if you want debug informations
tokensDebug: true
};tokens.use(options, function(_err, _opts){
if (_err) throw _err;
var bot = mineflayer.createBot(_opts);
bot.on('connect', function() {
console.info('connected');
});});
```
### Example with minecraft-protocol
```js
var mc = require('minecraft-protocol');
var tokens = require('prismarine-tokens');var options = {
host: 'localhost', // optional
port: 25565, // optional
username: '[email protected]',
password: '12345678',
//Location of the file to store and read tokens for this bot
//You can use the same file for all your bots
tokensLocation: './bot_tokens.json',
//Set to true if you want debug informations
tokensDebug: true
};tokens.use(options, function(_err, _opts){
if (_err) throw _err;
var client = mc.createClient(_opts);
client.on('connect', function() {
console.info('connected');
});});
```