Skip to content

Instantly share code, notes, and snippets.

@imharvol
Created August 29, 2021 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imharvol/6a2f5413799e8246d15b4a25f40a9228 to your computer and use it in GitHub Desktop.
Save imharvol/6a2f5413799e8246d15b4a25f40a9228 to your computer and use it in GitHub Desktop.
Place a end crystal using mineflayer
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