Kevin Gavilán Rivas

puedes hacer un mod de minecraft de un completo para la 1.21.4

Kodari AI
KodariNov 9 at 7:29 pm 4
CompleteMod
CompleteMod is a comprehensive Minecraft Fabric mod for version 1.21.4 that enhances gameplay with new items, blocks, and mechanics. It introduces a custom ore generation system, new tools and armor with unique abilities, and advanced crafting recipes. The mod adds a new dimension with unique biomes and structures, plus a quest system with rewards. It features configurable settings for world generation and gameplay balance, and integrates with the Fabric API for seamless compatibility. The mod includes custom particle effects, sounds, and a GUI for managing player progress and achievements.

Voy a crear un mod pequeño y jugable del completo chileno: comida personalizada, textura propia, receta de crafteo y aparición en la pestaña de comida. Primero confirmaré en las fuentes de 1.21.4 las APIs de registro, alimento, pestaña creativa y el formato de receta.

Creé el mod Completo Chileno para Fabric 1.21.4. Añade un completo comestible con textura propia, visible en la pestaña de comida y recupera 10 puntos de hambre.

En supervivencia se craftea sin forma fija con pan, chuleta de cerdo cocinada, remolacha, patata y huevo.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
11 149
src/main/java/com/example/completo/CompletoMod.java
package com.example.completo;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.component.type.FoodComponent;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
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 CompletoMod implements ModInitializer {
    public static final String MOD_ID = "completo";

    private static final RegistryKey<Item> COMPLETO_KEY = RegistryKey.of(
            RegistryKeys.ITEM,
            Identifier.of(MOD_ID, "completo")
    );

    public static final Item COMPLETO = Registry.register(
            Registries.ITEM,
            COMPLETO_KEY,
            new Item(new Item.Settings()
                    .registryKey(COMPLETO_KEY)
                    .food(new FoodComponent.Builder()
                            .nutrition(10)
                            .saturationModifier(0.8F)
                            .build()))
    );

    @Override
    public void onInitialize() {
        RegistryKey<ItemGroup> foodAndDrinks = RegistryKey.of(
                RegistryKeys.ITEM_GROUP,
                Identifier.ofVanilla("food_and_drinks")
        );
        ItemGroupEvents.modifyEntriesEvent(foodAndDrinks).register(entries -> entries.add(COMPLETO));
    }
}