Skip to content

Potion Brewing

LLytho edited this page Nov 11, 2023 · 2 revisions
// priority: 0
// for 1.18 pls use: onEvent("morejs.potion_brewing.register", (event) => { ... })
MoreJSEvents.registerPotionBrewing((event) => {
    /**
     * 1. Argument: The top ingredient of the brewing stand
     * 2. Argument: The bottom ingredient of the brewing stand
     * 3. Argument: The result of the brewing
     */
    event.addCustomBrewing(
        "minecraft:gold_ingot",
        Ingredient.customNBT("minecraft:potion", (nbt) => {
            return nbt.contains("Potion") && nbt.Potion == "minecraft:water";
        }),
        Item.of("minecraft:potion", { Potion: "kubejs:felix_felicis" }) // This is a custom made potion. It's not vanilla
    );

    event.addCustomBrewing("minecraft:diamond", "minecraft:emerald", "minecraft:gold_ingot");

    /**
     * 1. Argument: The ingredient of the brewing stand
     * 2. Argument: The input potion of the brewing stand
     * 3. Argument: The result potion of the brewing
     */
    event.addPotionBrewing("minecraft:emerald", "minecraft:fire_resistance", "minecraft:strength");

    /**
     * Simpler call which automatically use `potion:water` as the input potion.
     * 1. Argument: The ingredient of the brewing stand
     * 3. Argument: The result potion of the brewing
     */
    event.addPotionBrewing("minecraft:nether_star", "minecraft:levitation");

    /**
     * Removes all potions where an awkward potion is used as theb base potion ingredient.
     * 1. Argument: The input potion id to filter.
     * 2. Argument: The ingredient to filter.
     * 3. Argument: The result potion id to filter.
     * Passing `null` counts as a wildcard.
     */
    event.removeByPotion("minecraft:awkward", null, null);
});
Clone this wiki locally