znsuyt

make a mod which works with re-avaritia mod and when we open a inventory we can see there a infinity chest which is re-avaritia mod's item but that infinity chest name will be Upgrader chest in rainbow color and when we put anything in it that will upgrade to avaritia like if we put wooden sword it will upgrade to crystal sword or blaze skull sword which is re-avaritia mod's items and like if we put mace it will upgrade to infinity mace every normal thing will upgrade into avaritia and there will be infinity chest and upgrader chest also both will present in re-avaritia items menu

Kodari AI
KodariOct 26 at 8:28 am 6
InfinityUpgraderChest
Adds an "Upgrader Chest" item to the Re-Avaritia mod's item menu. When opened, the inventory displays a rainbow-colored Infinity Chest. Placing any vanilla or modded item inside automatically upgrades it to its Re-Avaritia equivalent, such as a wooden sword becoming a crystal sword, a mace becoming an infinity mace, and similar transformations for all supported items. Both the Infinity Chest and Upgrader Chest appear in the Re-Avaritia item listing, integrating seamlessly with the existing mod's item hierarchy and upgrade mechanics.
  1. Build the NeoForge 1.21.1 mod entry point, chest item, menu, and client screen.

  2. Make upgrades resolve against Re-Avaritia items at runtime and place the new chest in its creative tab.

  3. Add the required mod metadata, item model, and survival recipe.

Added the Rainbow Upgrader mod. Right-click the Upgrader Chest to open its input/output inventory; taking an upgraded item consumes one input. Its name is rainbow-colored, and the item is added to creative tabs whose namespace contains avaritia.

Upgrades are resolved at runtime from Re-Avaritia’s registered items: swords prioritize Crystal Sword, then Blaze Skull Sword; maces prioritize Infinity Mace. Other items use a matching weapon or armor category when available, otherwise the resolver selects a high-priority Avaritia item. Re-Avaritia must be installed, and its item registry names need to match those categories.

The existing Infinity Chest remains unchanged; the new Upgrader Chest is a separate item. Craft it in survival with an Ender Chest, a Nether Star, four Obsidian, and three Diamond Blocks.

znsuyt

it will look like infinity chest and inside menu will also same but only name difference and if we put inside it items and close and open it then that item will be upgraded

Kodari AI
KodariOct 26 at 8:46 am 7
  1. Match the Upgrader Chest’s item and menu presentation to Re-Avaritia’s Infinity Chest, keeping only its rainbow name different.

  2. Persist chest contents and upgrade them when the chest is reopened.

Updated the Upgrader Chest to use a 27-slot chest inventory, keep its contents when closed, and upgrade stored items when reopened. The rainbow Upgrader Chest title remains, and the item is still added to Re-Avaritia creative tabs.

For multi-item stacks, it upgrades one item at a time and preserves the remainder; an empty slot is needed for the upgraded item. The icon is now Infinity Chest-inspired, but Re-Avaritia’s exact texture and menu assets aren’t available in the mounted source, so I couldn’t make an exact copy.

Craft it with this pattern: O N O / D C D / O D O — obsidian (O), nether star (N), diamond blocks (D), and an Ender Chest (C).

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
13 479
src/main/java/com/kodari/rainbowupgrader/RainbowUpgraderMod.java
package com.kodari.rainbowupgrader;

import com.kodari.rainbowupgrader.item.UpgraderChestItem;
import com.kodari.rainbowupgrader.menu.UpgraderMenu;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.inventory.MenuType;
import net.minecraft.core.registries.Registries;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.common.extensions.IMenuTypeExtension;
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredItem;
import net.neoforged.neoforge.registries.DeferredRegister;

@Mod(RainbowUpgraderMod.MOD_ID)
public final class RainbowUpgraderMod {
    public static final String MOD_ID = "rainbowupgrader";

    private static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(MOD_ID);
    private static final DeferredRegister<MenuType<?>> MENUS = DeferredRegister.create(Registries.MENU, MOD_ID);

    public static final DeferredItem<UpgraderChestItem> UPGRADER_CHEST = ITEMS.registerItem(
            "upgrader_chest",
            UpgraderChestItem::new,
            new net.minecraft.world.item.Item.Properties().stacksTo(1)
    );
    public static final DeferredHolder<MenuType<?>, MenuType<UpgraderMenu>> UPGRADER_MENU = MENUS.register(
            "upgrader_chest",
            () -> IMenuTypeExtension.create((containerId, inventory, data) -> new UpgraderMenu(containerId, inventory))
    );

    public RainbowUpgraderMod(IEventBus modEventBus) {
        ITEMS.register(modEventBus);
        MENUS.register(modEventBus);
        modEventBus.addListener(this::addToAvaritiaTabs);
    }

    private void addToAvaritiaTabs(BuildCreativeModeTabContentsEvent event) {
        ResourceLocation tabId = event.getTabKey().location();
        if (tabId.getNamespace().contains("avaritia")) {
            event.accept(new ItemStack(UPGRADER_CHEST.get()), CreativeModeTab.TabVisibility.PARENT_TAB_ONLY);
        }
    }
}