Create a Minecraft NeoForge 1.21.1 mod named "Moonfall" that implements a progressive, apocalyptic lunar collision event. The mod must handle a global, syncing server variable called "moonProgress" (ranging from 0.0 to 1.0, where 1.0 is total impact).
Implement the following core systems across the mod architecture:
- REMOVE VANILLA MOON & RENDER CUSTOM 3D MOON:
- Use a client-side Mixin (such as LevelRenderer / WorldRenderer) to completely disable, cancel, or hide the default, flat vanilla Minecraft moon from rendering in the skybox at night.
- In its place, render a massive, custom true 3D Cube in the sky using the moon texture coordinates.
- Dynamically scale the size of this 3D Cube and lower its rendering Y-coordinate position closer to the world's horizon/player height as "moonProgress" increases towards 1.0.
- ANTI-GRAVITY ANOMALIES & LIFTING TERRAIN:
- Create a server-side tick listener (ServerTickEvents.END_SERVER_TICK) that dynamically calculates a gravity modifier based on the current "moonProgress".
- As the moon gets closer, lower the gravity of all players and living entities within the world. Apply this by smoothly modifying their velocity vectors on the Y-axis to create a floaty, low-gravity simulation.
- When moonProgress exceeds 0.5, randomly pick block positions and block chunks in a 64-block radius around players. Convert these targeted terrain blocks (like Grass, Dirt, Stone) into FallingBlockEntity objects and give them a continuous, gentle upward velocity so chunks of the world visually float up into the sky before breaking.
- ASTEROID STRIKES (BLOCK CLUMPS):
- Implement an asteroid spawning system where the frequency of strikes scales exponentially with "moonProgress".
- An asteroid must be generated as a tight, organic cluster (3x3 to 5x5 sphere) of heavy FallingBlockEntities (composed of Netherrack, Magma Blocks, and Obsidian).
- Spawn these clusters high in the sky directly above the player's general region, applying a downward and diagonal physics velocity to mimic a crashing meteor.
- On ground impact, trigger a destructive explosion (world.createExplosion) that shatters the surrounding terrain but leaves the asteroid's Netherrack and Magma blocks intact within the impact crater.
Ensure all network packets smoothly sync the moon's position from the server to the client, avoid destroying player containers like chests during terrain lifting, and generate a clean build
Set up the NeoForge 1.21.1 mod entry point, payload registration, and server-authoritative moon progress sync.
Add server-side low gravity, safe terrain lifting, asteroid clusters, and impact handling.
Add the client mixin/rendering path for a progressing 3D moon and hide only the vanilla moon.
Add the NeoForge metadata, mixin config, and required resources.
Created the Moonfall NeoForge 1.21.1 project.
Moon and sync: Server-authoritative
moonProgressadvances with overworld time, reaching 1.0 after seven in-game days. It syncs to players every 10 ticks and interpolates client-side; a client mixin hides the vanilla moon and renders a growing, descending 3D cube using the current vanilla moon phase.Low gravity and terrain lifting: Living entities receive a progress-scaled upward velocity adjustment. After progress passes 0.5, nearby grass, dirt, and stone can lift as falling blocks; the whitelist avoids containers and other block-entity structures.
Asteroids: Exponentially increasing spawn chance creates 3–5-block-wide falling clusters of netherrack, magma, and obsidian above overworld players. Impact triggers a terrain-destroying explosion and leaves netherrack and magma in the crater.
Project setup: Added the NeoForge 21.1.262 Gradle files, mod metadata, payload registration, and client-only mixin configuration.
package com.kodari.moonfall;
import net.neoforged.fml.common.Mod;
@Mod(Moonfall.MOD_ID)
public final class Moonfall {
public static final String MOD_ID = "moonfall";
}