Download Adam/control_primitives_context/killMob.js from OpenCausaLab/ADAM: direct link, hf CLI and curl.
- Browser
- Download file 446 Bytes
-
https://huggingface.co/OpenCausaLab/ADAM/resolve/main/Adam/control_primitives_context/killMob.js
- Command line
-
hf download hf://OpenCausaLab/ADAM/Adam/control_primitives_context/killMob.js
-
curl -L -o killMob.js https://huggingface.co/OpenCausaLab/ADAM/resolve/main/Adam/control_primitives_context/killMob.js
446 Bytes
| // Kill a pig and collect the dropped item: killMob(bot, "pig", 300); | |
| async function killMob(bot, mobName, timeout = 300) { | |
| const entity = bot.nearestEntity( | |
| (entity) => | |
| entity.name === mobName && | |
| entity.position.distanceTo(bot.entity.position) < 32 | |
| ); | |
| await bot.pvp.attack(entity); | |
| await bot.pathfinder.goto( | |
| new GoalBlock(entity.position.x, entity.position.y, entity.position.z) | |
| ); | |
| } | |