#Get block id instead of item id

3 messages · Page 1 of 1 (latest)

unborn fossil
#

This script right here works with most ores:

ServerEvents.recipes((event) => {
// Remove all soil recipes
event.remove({ type: "botanypots:soil" });

// Remove all fertilizer recipes
event.remove({ type: "botanypots:fertilizer" });

// Define the base soil recipe (same as before)
event.recipes.botanypots.soil(
"aether:cold_aercloud", // the item that this soil is attached to
{ block: "aether:cold_aercloud" }, // display block
["cold_aercloud"], // categories that this soil provides
200, // growth ticks that this soil will provide
1 // growthModifier (ensure no speed-up)
);

// Get all blocks tagged as 'forge:ores'
const ores = Ingredient.of("#forge:ores").stacks;

// Loop through each ore and create a crop recipe for it
ores.forEach((ore) => {
const oreId = ore.id; // Get the item ID of the ore

event.recipes.botanypots.crop(
  oreId, // The ore block itself is the seed item
  ["cold_aercloud"], // Categories of soil allowed
  { block: oreId }, // Display block (same as the planted item)
  [
    Item.of(oreId) // Output the same ore block
      .withChance(100) // 100% chance to drop the ore
      .withRolls(1), // Only one item will drop
  ],
  1000, // growthTicks (50 seconds)
  1 // growthModifier (ensure no speed-up)
);

console.info(`Added Botany Pot recipe for ${oreId}`);

});
});

console.info("Custom Botany Pots recipes for ores added.");

But some modded ores only have "forge:ores" under block tags, not items tags. Is it possible to get block tags instead of item tags?

I added some pictures for context

slow steppeBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

grand viperBOT
#

You can write your code in a codeblock by typing it between the codeblock delimiters:
Note that these are backticks, not apostrophes

```js :arrow_left:

ServerEvents.recipes(event => {
event.smelting('minecraft:glass', '#forge:sand').xp(.1)
})

``` :arrow_left:

This example will look like this:

ServerEvents.recipes(event => {
  event.smelting('minecraft:glass', '#forge:sand').xp(.1)
})