Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var mineflayer = require('mineflayer');
- var blockFinder = require('mineflayer-blockfinder')(mineflayer);
- var bot = mineflayer.createBot({
- username: "",
- password: "",
- host: "cafe-mc.com",
- version: "1.8.9"
- });
- bot.once('login', () => {
- console.log("logged in");
- console.log("started to sniff the chat");
- bot.chat("/tpa Hadn")
- });
- bot.on("chat", (username, message) => {
- console.log(username + ": " + message)
- });
- bot.on("kicked", (reason, loggedIn) => {
- if (loggedIn) {
- console.log("got kicked for: " + reason)
- }
- else {
- console.log("couldnt log on for the reason: " + reason)
- }
- })
- bot.loadPlugin(blockFinder);
- bot.on('chat', (username, message) => {
- if (username == "Hadn" && message == "start") {
- console.log("started?") // remove l8r
- bot.findBlock({
- point: bot.entity.position,
- matching: 77, // stone button DOES NOT GIVE OUT AN OBJECT WITH THIS LOL WTF??
- maxDistance: 32,
- count: 1
- }, (err, blockinfo) => {
- if (err) {
- console.log("error cant find block")
- }
- if (blockinfo) {
- console.log("found blockerman")
- console.log(blockinfo)
- bot.activateBlock(blockinfo[0].position)
- }
- else {
- console.log("cant find blockerman")
- }
- }
- )
- }})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement