hunting fix

This commit is contained in:
Kolby Nottingham 2024-02-12 22:53:26 -08:00
parent 57783fb4ca
commit 6b123c275e
3 changed files with 6 additions and 4 deletions

View file

@ -7,7 +7,7 @@
"torch",
"stone_pickaxe",
"stone_sword",
"leather_tunic",
"leather_chestplate",
"iron_pickaxe",
"iron_sword",
"iron_helmet",

View file

@ -192,7 +192,6 @@ class ItemWrapper {
this.methods.push(method);
}
createChildren() {
let recipes = mc.getItemCraftingRecipes(this.name);
if (recipes) {
@ -302,7 +301,8 @@ export class ItemGoal {
let next = goal.getNext();
// Prevent unnecessary attempts to obtain blocks that are not nearby
if (next.type === 'block' && !world.getNearbyBlockTypes(this.agent.bot).includes(next.source)) {
if (next.type === 'block' && !world.getNearbyBlockTypes(this.agent.bot).includes(next.source) ||
next.type === 'hunt' && !world.getNearbyEntityTypes(this.agent.bot).includes(next.source)) {
next.fails += 1;
await new Promise((resolve) => setTimeout(resolve, 500));
this.agent.bot.emit('idle');

View file

@ -172,7 +172,9 @@ export function getItemAnimalSource(itemName) {
raw_mutton: 'sheep',
raw_porkchop: 'pig',
raw_rabbit: 'rabbit',
raw_salmon: 'salmon'
raw_salmon: 'salmon',
leather: 'cow',
wool: 'sheep'
}[itemName];
}