raiveniee

a custom potion with the appearance of a vanilla potion of luck named zaza extract that gives you a 3 minutes nausea effect. ported to 1.21.11 fabric

Kodari AI
KodariNov 2 at 11:39 pm 3
ZazaExtractPotion
Adds a custom potion named "Zaza Extract" to Minecraft Fabric 1.21.11, visually appearing as a vanilla Potion of Luck. When consumed, it applies a 3-minute Nausea effect to the player. The mod registers a custom potion type, brewing recipe, and item, integrating seamlessly with vanilla brewing mechanics while providing a unique gameplay twist.
  • Register a drinkable potion with nausea for three minutes and the luck potion’s color.

  • Add a survival recipe, creative-tab entry, and vanilla-style potion appearance.

Created Zaza Extract for Fabric 1.21.11. It looks like a potion of luck and gives three minutes of nausea.

In survival, craft it with a pufferfish and a glass bottle.

raiveniee

add another potion just like it but named zaza extract ultimate that gives 4 minutes nausea and 3 minutes strength 2

Kodari AI
KodariNov 2 at 11:41 pm 2
  • Add the ultimate extract with four minutes of nausea and three minutes of Strength II.

  • Make it craftable from Zaza Extract and blaze powder.

Added Zaza Extract Ultimate with 4 minutes of nausea and 3 minutes of Strength II.

Craft it with Zaza Extract and blaze powder.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
10 178
src/main/java/com/example/zazaextract/ZazaExtract.java
package com.example.zazaextract;

import java.util.List;
import java.util.Optional;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.ConsumableComponents;
import net.minecraft.component.type.PotionContentsComponent;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;

public class ZazaExtract implements ModInitializer {
    private static final RegistryKey<Item> KEY = RegistryKey.of(RegistryKeys.ITEM, Identifier.of("zaza_extract", "zaza_extract"));
    public static final Item EXTRACT = Registry.register(Registries.ITEM, KEY, new Item(new Item.Settings()
            .registryKey(KEY)
            .maxCount(1)
            .component(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(
                    Optional.empty(), Optional.of(5882118),
                    List.of(new StatusEffectInstance(StatusEffects.NAUSEA, 3600)), Optional.empty()))
            .component(DataComponentTypes.CONSUMABLE, ConsumableComponents.DRINK)
            .useRemainder(Items.GLASS_BOTTLE)));
    private static final RegistryKey<Item> ULTIMATE_KEY = RegistryKey.of(RegistryKeys.ITEM, Identifier.of("zaza_extract", "zaza_extract_ultimate"));
    public static final Item ULTIMATE_EXTRACT = Registry.register(Registries.ITEM, ULTIMATE_KEY, new Item(new Item.Settings()
            .registryKey(ULTIMATE_KEY)
            .maxCount(1)
            .component(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(
                    Optional.empty(), Optional.of(5882118),
                    List.of(new StatusEffectInstance(StatusEffects.NAUSEA, 4800),
                            new StatusEffectInstance(StatusEffects.STRENGTH, 3600, 1)), Optional.empty()))
            .component(DataComponentTypes.CONSUMABLE, ConsumableComponents.DRINK)
            .useRemainder(Items.GLASS_BOTTLE)));

    @Override
    public void onInitialize() {
        ItemGroupEvents.modifyEntriesEvent(RegistryKey.of(RegistryKeys.ITEM_GROUP, Identifier.of("minecraft", "food_and_drinks")))
                .register(entries -> {
                    entries.add(EXTRACT);
                    entries.add(ULTIMATE_EXTRACT);
                });
    }
}