mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-21 21:52:07 +02:00
fixed crafting error message
This commit is contained in:
parent
5e25536d37
commit
c36fb02c9e
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
import { getItemId, getItemName } from "./mcdata.js";
|
||||
import { getItemId } from "./mcdata.js";
|
||||
import { getNearestBlock, getInventoryCounts, getInventoryStacks, getNearbyMobs, getNearbyBlocks } from "./world.js";
|
||||
import pf from 'mineflayer-pathfinder';
|
||||
import Vec3 from 'vec3';
|
||||
|
@ -24,7 +24,7 @@ export async function craftItem(bot, itemName, num=1) {
|
|||
if (!recipes || recipes.length === 0) {
|
||||
craftingTable = getNearestBlock(bot, 'crafting_table', 6);
|
||||
if (craftingTable === null){
|
||||
log(bot, `${itemName} requires crafting table, but there is none nearby.`)
|
||||
log(bot, `You either do not have enough resources to craft ${itemName} or it requires a crafting table, but there is none nearby.`)
|
||||
return false;
|
||||
}
|
||||
recipes = bot.recipesFor(getItemId(itemName), null, num, craftingTable);
|
||||
|
|
Loading…
Add table
Reference in a new issue