CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PrismarineJS

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: PrismarineJS/mineflayer
Path: blob/master/examples/skin_data.js
Views: 789
1
/*
2
* This script will automatically set if a totem is in the inventory or the off-hand.
3
* It checks for a totem every tick.
4
*/
5
const mineflayer = require('mineflayer')
6
7
if (process.argv.length < 4 || process.argv.length > 6) {
8
console.log('Usage : node skin_data.js <host> <port> [<name>] [<password>]')
9
process.exit(1)
10
}
11
12
const bot = mineflayer.createBot({
13
host: process.argv[2],
14
port: parseInt(process.argv[3]),
15
username: process.argv[4] ? process.argv[4] : 'skin_data',
16
password: process.argv[5]
17
})
18
19
setTimeout(() => {
20
bot.quit()
21
console.log('Skin data:')
22
console.log(Object.entries(bot.players).map(([name, player]) => ({
23
name,
24
skinData: player.skinData
25
})))
26
}, 10000)
27
28