BlakeBr0 / MysticalCustomization

Allows modpack creators to add new content and modify existing content in Mystical Agriculture.
https://blakesmods.com/mystical-customization
MIT License
6 stars 6 forks source link

1.18.2 How put kubejs custom items in ingredients #30

Closed RapidMesck closed 1 year ago

RapidMesck commented 1 year ago

Describe the bug the recipe cannot identify a custom item from kubejs

Screenshots / Scripts / Logs

{
    "name": "Elemental Rune",
    "type": "mysticalagriculture:resource",
    "tier": "mysticalagriculture:2",
    "ingredient": {
      "tag": "kubejs:elemental_agglomeratio"
    },
    "color": "fee4ab",
    "textures": {
      "flower": "mysticalagriculture:block/flower_rock",
      "essence": "mysticalagriculture:item/essence_rock"
    }
  }

image image

Versions (please complete the following information):

RapidMesck commented 1 year ago

I used this solution:

i made a custom recipe using kubejs in infuser altar for seed

exemple code:

let mysticalAltar = (e, output, middleItem, ingredientList) => {
        e.custom({
            type: 'mysticalagriculture:infusion',
            input: { item: middleItem },
            ingredients: ingredientList.map(item => (item.charAt(0) === '#') ? { tag: item.substring(1) } : { item: item }),
            result: { item: output }
        }).id(`kubejs:infusion_altar_crafting/${output.replace(':', '/')}`);
    };

onEvent('recipes', event => {

 mysticalAltar(event, 'mysticalagriculture:elemental_rune_seeds', 'mysticalagriculture:prosperity_seed_base',['mysticalagriculture:prudentium_essence', 'mysticalagriculture:prudentium_essence', 'mysticalagriculture:prudentium_essence', 'mysticalagriculture:prudentium_essence', 'kubejs:elemental_agglomeratio', 'kubejs:elemental_agglomeratio', 'kubejs:elemental_agglomeratio', 'kubejs:elemental_agglomeratio'])

})

image

Versions:

Minecraft: 1.18.2 Forge: 40.2.0 Cucumber: Cucumber-1.18.2-5.1.3 Mystical Agriculture: MysticalAgriculture-1.18.2-5.1.4 Mystical Customization: MysticalCustomization-1.18.2-3.1.2 Kubejs: kubejs-forge-1802.5.5-build.569

BlakeBr0 commented 1 year ago

Did you mean to use a tag in the first example? You seem to be using an item id in the second example.

RapidMesck commented 1 year ago

I updated the code in the ingredient variable part and it worked

{
  (Code...)

  "ingredient": {
    "item": "kubejs:elemental_agglomeratio"
  }
}