Created
August 29, 2021 14:46
-
-
Save imharvol/6a2f5413799e8246d15b4a25f40a9228 to your computer and use it in GitHub Desktop.
Place a end crystal using mineflayer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mineflayer = require('mineflayer') | |
const vec3 = require('vec3') | |
const bot = mineflayer.createBot({ | |
host: 'localhost', | |
port: 40283, | |
username: 'test', | |
version: '1.16.5' | |
}) | |
bot.once('spawn', async () => { | |
await sleep(2000) | |
const blockPos = bot.entity.position.floored().offset(3, -1, 0) | |
bot.chat('/clear\n') | |
bot.chat('/give test end_crystal\n') | |
bot.chat(`/setblock ${blockPos.toArray().join(' ')} bedrock\n`) | |
await sleep(2000) | |
bot.placeEntity(bot.blockAt(blockPos), vec3(0, 1, 0)) | |
}) | |
function sleep (ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment