Program exit with
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
when executing the sample task:
const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
host: 'localhost',
username: 'bot1',
auth: 'offline',
port: 2037,
})
// Load collect block
bot.loadPlugin(require('mineflayer-collectblock').plugin)
async function collectStone() {
// Find a nearby stone block
const stone = bot.findBlock({
matching: mcData.blocksByName.stone.id,
maxDistance: 64
})
if (stone) {
// If we found one, collect it.
try {
await bot.collectBlock.collect(stone)
collectStone() // Collect another stone block
} catch (err) {
console.log(err) // Handle errors, if any
}
}
}
// On spawn, start collecting all nearby stone
bot.once('spawn', () => {
mcData = require('minecraft-data')(bot.version)
collectStone()
})
Program exit with
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
when executing the sample task:The console log:
The stone is right next to the agent, and agent is not mining.