prismarinejs / prismarine-recipe Goto Github PK
View Code? Open in Web Editor NEWRepresent minecraft recipes
Represent minecraft recipes
I need to know what ingredients are used to create an item,
The recipe returns null ingredients used
I need this so that the "BOT" knows what ingredients to take from the chest
recipesAll mus be appear all recipes & ingredients, right?
amount = parseInt(amount, 10)
const mcData = require('minecraft-data')(bot.version)
const item = mcData.findItemOrBlockByName('stone_sword')
// mcData.itemsByName.pumpkin_seeds
const craftingTableID = mcData.blocksByName.crafting_table.id
const craftingTable = bot.findBlock({
matching: craftingTableID,
maxDistance: 3
})
if (!item) {
bot.chat(`unknown item: ${name}`)
return
}
const aviableRecipes = bot.recipesAll(item.id, null, craftingTable)
Variables:
Related issue PrismarineJS/mineflayer#2001
Example:
Recipe for diamond_pickaxe in versions 1.9.4, 1.10.2 and 1.13.2 lists two ingridients but no inShape.
The crafting recipe in itself is invalid as the two ingridients are the ID of the result itself.
Causes new crafting tests in PrismarineJS/mineflayer#2418 to fail.
https://github.com/PrismarineJS/prismarine-recipe/blame/a98e33c3340f0bff2d2e707e7876ebf190386989/lib/recipe_item.js#L12
esbuild just told me it is not possible (impossible-typeof)
Hello,
when working with prismarine-recipe and typescript I noticed that the RecipeItemConstructor Type is wrong and the default export is also not correct.
Currently, in index.d.ts:
export type RecipeItemConstructor = typeof Recipe;
Should be:
export type RecipeItemConstructor = typeof RecipeItem;
also the loader function is not declared as the default export:
export declare function loader(mcVersion: string): RecipeClasses;
what should be
declare function loader(mcVersion: string): RecipeClasses;
export default loader;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.