Kacmen

Write me a mod for version 1.21.1 of NeoForge that will replace ordinary villages with large medieval cities, for example, like Novigrad from The Witcher, and make it so that the village is surrounded by walls and there are gates to the city on two different sides.

Kodari AI
KodariOct 4 at 8:25 am 1
MedievalCityVillages
Replaces vanilla villages with sprawling medieval walled cities inspired by Novigrad. Generates large urban layouts with varied buildings, plazas, and winding streets. Surrounds each city with tall defensive walls featuring two grand gates on opposite sides. Integrates with vanilla structure generation, preserving villager professions and trades while enhancing the aesthetic and scale of settlements.

This project is set up for Fabric 1.21.11, not NeoForge 1.21.1. I can build the medieval-city mod for Fabric 1.21.11, with large walled cities and gates on opposite sides. Would you like me to proceed with that version?

Kacmen

mod for Fabric 1.21.11

Kodari AI
KodariOct 4 at 8:27 am 1
  1. Add a Fabric 1.21.11 mod entrypoint and metadata.

  2. Generate large walled city layouts with two opposite gates during world generation.

  3. Prevent vanilla villages from generating in the same eligible biomes.

[Generation stopped]

Kacmen

Yes, I want it to continue on this version.

Kodari AI
KodariOct 4 at 8:39 am 3
  1. Register a procedural city feature and place it across Overworld biomes.

  2. Suppress vanilla jigsaw starts only when their start pool is a vanilla village pool.

  3. Add city-generation data, Fabric metadata, and the 1.21.11 Loom project files.

Created the Fabric 1.21.11 mod. It suppresses vanilla village structures and generates roughly 160×160-block medieval cities on a world grid, with defensive walls, towers, streets, varied buildings, a central keep, and two opposing gates. The project includes the Fabric metadata and world-generation data files.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
10 419
src/main/java/com/kodari/medievalcities/MedievalCities.java
package com.kodari.medievalcities;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
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;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.feature.PlacedFeature;

public final class MedievalCities implements ModInitializer {
    public static final String MOD_ID = "medievalcities";

    @Override
    public void onInitialize() {
        Registry.register(Registries.FEATURE, Identifier.of(MOD_ID, "medieval_city"), new MedievalCityFeature());

        RegistryKey<PlacedFeature> cityFeature = RegistryKey.of(
                RegistryKeys.PLACED_FEATURE,
                Identifier.of(MOD_ID, "medieval_city")
        );
        BiomeModifications.addFeature(
                BiomeSelectors.foundInOverworld(),
                GenerationStep.Feature.TOP_LAYER_MODIFICATION,
                cityFeature
        );
    }
}