about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2023-02-15 19:30:09 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2023-02-15 19:30:09 +0100
commit10fb737a45e6f9c9fea4b520068e5fde33ddaaf4 (patch)
treedf961fea4e21fd1fe2976bfc5acfa456f1b512d0 /src
parentBot: Add autoArmor plugin (diff)
download2bored2walk-10fb737a45e6f9c9fea4b520068e5fde33ddaaf4.tar.gz
2bored2walk-10fb737a45e6f9c9fea4b520068e5fde33ddaaf4.tar.bz2
2bored2walk-10fb737a45e6f9c9fea4b520068e5fde33ddaaf4.zip
Bot: Add autoTotem plugin
Diffstat (limited to 'src')
-rw-r--r--src/main.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.ts b/src/main.ts
index 0a28ea4..8e87abc 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -3,6 +3,7 @@ import mineflayer from 'mineflayer';
 import { ChannelType, Client, GatewayIntentBits } from "discord.js";
 const mineflayerViewer = require('prismarine-viewer').mineflayer
 const antiHunger = require('mineflayer-antihunger').plugin
+const autoTotem = require('mineflayer-auto-totem').autototem
 import { pathfinder, Movements, goals } from 'mineflayer-pathfinder';
 import { plugin as autoeat } from 'mineflayer-auto-eat';
 import autoArmor from '@nxg-org/mineflayer-auto-armor';
@@ -52,6 +53,7 @@ bot.loadPlugin(pathfinder)
 bot.loadPlugin(autoeat)
 bot.loadPlugin(antiHunger)
 bot.loadPlugin(autoArmor)
+bot.loadPlugin(autoTotem)
 
 bot.once('spawn', () => {
   mineflayerViewer(bot, { firstPerson: true, port: 3000 });
@@ -85,6 +87,10 @@ bot.on('health', () => {
     quit(`low hp: ${bot.health}`)
 })
 
+bot.on("physicsTick", async () => {
+  (bot as any).autototem.equip()
+})
+
 setInterval(() => {
   if (bot._client.state !== "play") return