Imran Abdo

make me a dimension under the nether called the underworld just like unstable smp underworld red sky like nether mixed cords like map is un natrul terrian

Kodari AI
KodariOct 9 at 7:01 pm 7
UnderworldDimension
Creates a custom dimension beneath the Nether called the Underworld, accessible via a portal or command. Features a red, ominous sky similar to the Nether but with unique, unnatural terrain generation including floating islands, jagged spikes, and distorted landscapes. Includes custom biome definitions, world generation settings, and dimension registration using Fabric API. Players can enter through a special portal block or /execute in underworld:underworld command. The dimension has its own lighting, fog, and particle effects for an eerie atmosphere, with coordinates mapped to the overworld at a 1:8 ratio for exploration.
  1. Add the Underworld dimension with a red sky and rugged overworld-style terrain.

  2. Mix Nether and Overworld biomes so it feels like a strange world beneath the Nether.

Created The Underworld with a crimson sky, dramatic amplified terrain, and a mix of Nether and Overworld biomes.

To reach it in survival, craft an Underworld Sigil from 4 crying obsidian, 4 echo shards, and 1 netherite ingot, then use it to travel between the Overworld and Underworld.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
12 365
src/main/java/com/kodari/underworldmod/UnderworldMod.java
package com.kodari.underworldmod;

import java.util.Set;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.creativetab.v1.CreativeModeTabEvents;
import net.fabricmc.fabric.api.event.player.UseItemCallback;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.Relative;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.Level;

public class UnderworldMod implements ModInitializer {
	public static final String MOD_ID = "underworldmod";
	private static final ResourceKey<Level> UNDERWORLD_KEY = ResourceKey.create(
		Registries.DIMENSION,
		Identifier.fromNamespaceAndPath(MOD_ID, "underworld")
	);
	private static final ResourceKey<Item> SIGIL_KEY = ResourceKey.create(
		Registries.ITEM,
		Identifier.fromNamespaceAndPath(MOD_ID, "underworld_sigil")
	);
	public static final Item UNDERWORLD_SIGIL = Registry.register(
		BuiltInRegistries.ITEM,
		SIGIL_KEY,
		new Item(new Item.Properties().setId(SIGIL_KEY))
	);

	@Override
	public void onInitialize() {
		CreativeModeTabEvents.modifyOutputEvent(ResourceKey.create(
			Registries.CREATIVE_MODE_TAB,
			Identifier.fromNamespaceAndPath("minecraft", "tools_and_utilities")
		)).register(output -> output.accept(
			new ItemStack(UNDERWORLD_SIGIL),
			CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS
		));

		UseItemCallback.EVENT.register((player, level, hand) -> {
			if (player.getItemInHand(hand).getItem() != UNDERWORLD_SIGIL) {
				return InteractionResult.PASS;
			}
			if (level.isClientSide()) {
				return InteractionResult.SUCCESS;
			}
			if (!(player instanceof ServerPlayer serverPlayer)) {
				return InteractionResult.PASS;
			}

			MinecraftServer server = level.getServer();
			if (server == null) {
				return InteractionResult.PASS;
			}

			ResourceKey<Level> destinationKey = level.dimension().equals(UNDERWORLD_KEY)
				? Level.OVERWORLD
				: UNDERWORLD_KEY;
			ServerLevel destination = server.getLevel(destinationKey);
			if (destination == null) {
				return InteractionResult.PASS;
			}

			int x = (int) Math.floor(player.getX());
			int z = (int) Math.floor(player.getZ());
			int y = destination.getHeight(Heightmap.Types.MOTION_BLOCKING, x, z);
			serverPlayer.teleportTo(
				destination,
				x + 0.5,
				y + 1.0,
				z + 0.5,
				Set.of(),
				serverPlayer.getYRot(),
				serverPlayer.getXRot(),
				true
			);
			return InteractionResult.SUCCESS;
		});
	}
}