// Smelt 5 raw iron using the available coal as fuel
await smeltItem (bot , " raw_iron " , " coal " , 5) ;
bot . chat ("5 raw iron smelted .");

Skill library example 4: fillBucketWithWater.

async function fillBucketWithWater ( bot ) {
// Find a water block nearby

const waterBlock = await exploreUntil (bot , new Vec3 (1 , 0, 1) , 60 , ()

=> {
const water = bot . findBlock ({

matching : mcData . blocksByName . water .id ,
maxDistance : 32

}) ;
return water ;

}) ;
if (! waterBlock ) {

bot . chat (" Could not find water .");
return ;

// Go to the water block
const adjacentBlock = waterBlock . position . offset (0 , 1, 0) ;
await bot . pathfinder . goto (

new GoalGetToBlock ( adjacentBlock .x , adjacentBlock .y ,

adjacentBlock .z)

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

// Equip the bucket
const bucket = bot . inventory . findInventoryItem ( mcData . itemsByName .

bucket . id );

await bot . equip ( bucket , " hand ");

33
VOYAGER- An Open-Ended Embodied Agent with Large Language Models