qbcore-framework / qb-inventory

Slot Based Inventory System Used With QB-Core :school_satchel:
GNU General Public License v3.0
50 stars 380 forks source link

[BUG] Recipe for new crafting items don't display #363

Closed Revline-RP closed 1 year ago

Revline-RP commented 2 years ago

Summary

Recipe for new crafting items don't display

Reproduction

I added some new items to craft in the config:

[13] = { name = "turbo", amount = 50, info = {}, costs = { ["steel"] = 14, ["plastic"] = 5, ["aluminum"] = 32, ["metalscrap"] = 50, }, type = "item", slot = 13, threshold = 0, points = 11, }, [14] = { name = "engine1", amount = 50, info = {}, costs = { ["steel"] = 24, ["plastic"] = 5, ["aluminum"] = 32, ["metalscrap"] = 50, }, type = "item", slot = 14, threshold = 0, points = 11, }, [15] = { name = "engine2", amount = 50, info = {}, costs = { ["steel"] = 34, ["plastic"] = 15, ["aluminum"] = 32, ["metalscrap"] = 75, }, type = "item", slot = 15, threshold = 0, points = 11, }, [16] = { name = "engine3", amount = 50, info = {}, costs = { ["steel"] = 34, ["plastic"] = 15, ["aluminum"] = 32, ["rubber"] = 20, ["metalscrap"] = 175, }, type = "item", slot = 16, threshold = 0, points = 11, }, [17] = { name = "engine4", amount = 50, info = {}, costs = { ["steel"] = 40, ["plastic"] = 15, ["aluminum"] = 50, ["rubber"] = 20, ["metalscrap"] = 200, }, type = "item", slot = 17, threshold = 0, points = 11, }, [18] = { name = "weapon_compactrifle", amount = 50, info = {}, costs = { ["iron"] = 33, ["steel"] = 44, ["plastic"] = 55, ["aluminum"] = 22, ["metalscrap"] = 50, }, type = "weapon", slot = 18, threshold = 1000, points = 11, }, [19] = { name = "weapon_assaultrifle", amount = 50, info = {}, costs = { ["iron"] = 53, ["steel"] = 54, ["plastic"] = 55, ["aluminum"] = 32, ["metalscrap"] = 100, }, type = "weapon", slot = 19, threshold = 2000, points = 11, },

Now in the html/js/app.js it is throwing the following error on the client side:

image

And now people can't see what items they need to craft the items on the crafting bench.

It's throwing the error on this line:

} else if ( itemData.info.costs != undefined && itemData.info.costs != null )

Expected behavior

I expected to be able to add items flawlessly into the crafting system and people can see the recipe.

Actual behavior

When adding new crafting items to the config file, it can't read the property costs anymore.

Additional context

No response

Last Updated

3 weeks ago

Custom Resources

jim mechanic for the items

Resource Rename

No

nzkfc commented 2 years ago

IIRC you have to add the item in two places, one in the config and the other in a JS file somewhere. Do a item search on one that works and you should find it.

github-actions[bot] commented 1 year ago

This issue has had 60 days of inactivity & will close within 7 days