water block ... ");
}

bot . chat (" No path to the water block . Trying to find another

}

}

// Move to a block adjacent to the water block
const adjacentBlock = waterBlock . position . offset (0 , 1, 0) ;
await bot . pathfinder . goto ( new GoalBlock ( adjacentBlock .x ,

adjacentBlock .y , adjacentBlock .z));

// Look at the water block
await bot . lookAt ( waterBlock . position );

// Equip the fishing rod
await bot . equip ( fishingRod , " hand ");

// Fish in the water 5 times
for ( let i = 0; i < 5; i ++) {

try {

await bot . fish () ;
bot . chat (‘ Fish ${i + 1} caught . ‘);

} catch ( error ) {

if ( error . message === " Fishing cancelled ") {

bot . chat (" Fishing was cancelled . Trying again ... ");
i - -; // Retry the same iteration

} else {

throw error ;

}

}

}

}

34

A.5 Self-Verification

A.5.1 Components in the Prompt

The input prompt to GPT-4 consists of the following components:
VOYAGER- An Open-Ended Embodied Agent with Large Language Models