📎
1 file
6,701 chars
📄
pasted-code-1790350439435.txt
txt
342 lines
▶
pasted-code-1790350439435.txt
txt
342 lines
ORBITAL RAILGUN — CLEAN BUILD FROM SCRATCH
================================================
Create a completely new Minecraft Fabric mod called:
ORBITAL RAILGUN
IMPORTANT:
I want a stable, working Railgun first.
Do NOT over-engineer the project.
Do NOT create complicated rendering mixins.
Do NOT modify Minecraft's internal rendering/FOV methods.
The Railgun should behave like a normal working Minecraft weapon with
a proper 3D model and animations.
================================================
ENVIRONMENT
================================================
Minecraft: 1.21.11
Fabric Loader: 0.19.3
Java: 21
GeckoLib: 5.4.5
Mod ID:
orbital_railgun
Package:
com.krazaq.orbitalrailgun
Author:
Krazaq
Mod Name:
Orbital Railgun
================================================
PHASE 1 — WORKING RAILGUN
================================================
Create ONE working Orbital Railgun.
Item ID:
orbital_railgun:orbital_railgun
Command:
/give @s orbital_railgun:orbital_railgun
The item must:
- appear in Creative inventory
- have a proper 3D model
- have a proper texture
- render in first person
- render in third person
- work when held
- have idle animation
- have aim animation
- have charge animation
- have fire animation
- have firing sound
- have charge sound
- have impact sound
================================================
3D MODEL
================================================
Use GeckoLib 5.4.5.
Create:
OrbitalRailgunItem
OrbitalRailgunModel
OrbitalRailgunRenderer
Use the correct GeckoLib 5.4.5 item-rendering API for Minecraft 1.21.11.
The renderer MUST be initialized using the correct client lifecycle.
IMPORTANT:
Do NOT instantiate the renderer too early.
Do NOT create the renderer in static initialization if that causes
MinecraftClient/resource-manager access before initialization.
Do NOT use:
- reflection hacks
- renderer mixins
- FOV mixins
- camera mixins
- CallbackInfo.cancel()
- CallbackInfoReturnable.setReturnValue()
- unsafe Minecraft client access during mod initialization
================================================
RESOURCE STRUCTURE
================================================
Use:
assets/orbital_railgun/
geo/
orbital_railgun.geo.json
animations/
orbital_railgun.animation.json
textures/
item/
orbital_railgun.png
sounds/
railgun_aim.ogg
railgun_charge.ogg
railgun_fire.ogg
railgun_impact.ogg
All resource names must be lowercase.
Namespace must ALWAYS be:
orbital_railgun
================================================
ANIMATIONS
================================================
Create these GeckoLib animations:
idle
aim
charge
fire
Keep them visually noticeable but stable.
The weapon should:
IDLE:
remain stable
AIM:
move into aiming position
CHARGE:
show energy buildup
FIRE:
perform a strong firing motion
Do NOT create a complicated state machine.
================================================
BASIC RAILGUN BEHAVIOR
================================================
Right click:
Start aiming/charging.
Hold right click:
Continue charging.
Release right click:
Fire the Railgun.
Add a reasonable cooldown so it cannot be spammed.
The Railgun must work in survival and creative.
================================================
VISUAL EFFECTS
================================================
Add simple effects:
- charge particles
- muzzle flash
- beam/shot effect
- impact particles
Keep these simple in PHASE 1.
Do NOT add complicated camera effects yet.
================================================
SOUND
================================================
Use:
railgun_aim
railgun_charge
railgun_fire
railgun_impact
Sounds should be properly registered and played from the client/server
architecture appropriate for Fabric.
================================================
IMPORTANT — NO SKINS YET
================================================
DO NOT add the 10 skin system in PHASE 1.
DO NOT add:
PLASMA
VOID
NETHER
ENDER
LIGHTNING
SOLAR
NUCLEAR
GALAXY
FROST
yet.
We will add skins only after the base Railgun is confirmed working.
================================================
IMPORTANT — NO AIM ZOOM YET
================================================
Do NOT add custom FOV or aim zoom.
Do NOT modify Minecraft's FOV calculation.
Do NOT create any aimZoom mixin.
We will add safe aim zoom later if needed.
================================================
AUTHOR
================================================
Set the public author to:
Krazaq
Do NOT mention Kodari as the author.
Keep:
mod_id = orbital_railgun
================================================
BUILD REQUIREMENT
================================================
Run:
./gradlew clean build
Fix every compilation error.
The final build MUST say:
BUILD SUCCESSFUL
================================================
TEST CHECKLIST
================================================
Before finishing, verify:
[ ] Minecraft starts
[ ] Main menu opens
[ ] No startup crash
[ ] World loads
[ ] Creative inventory contains Railgun
[ ] /give @s orbital_railgun:orbital_railgun works
[ ] First-person 3D model works
[ ] Third-person 3D model works
[ ] Texture works
[ ] Idle animation works
[ ] Aim animation works
[ ] Charge animation works
[ ] Fire animation works
[ ] Charge sound works
[ ] Fire sound works
[ ] Impact sound works
[ ] Particles work
[ ] No GeckoLib initialization crash
[ ] No renderer initialization crash
[ ] No rendering mixin crash
================================================
CRITICAL FINAL RULE
================================================
DO NOT add extra systems just because they seem useful.
FIRST make this simple Railgun completely stable.
Do not proceed to advanced features until:
Minecraft launches successfully
AND
the 3D Railgun is visible and usable.
After the build succeeds, provide the compiled JAR.
================================================
FUTURE PHASES
================================================
After PHASE 1 is confirmed working, we will separately add:
PHASE 2:
10 Railgun skins
PHASE 3:
skin-specific aim animations
PHASE 4:
skin-specific fire animations
PHASE 5:
skin-specific sounds
PHASE 6:
skin-specific particles and beams
PHASE 7:
skin selector/menu
PHASE 8:
final polish
DO NOT implement those phases now.
KodariSep 25 at 4:24 pm 4
OrbitalRailgun
Creates a functional Orbital Railgun weapon mod for Minecraft Fabric 1.21.11 using GeckoLib 5.4.5. The mod adds a single 3D-modeled railgun item with idle, aim, charge, and fire animations, plus corresponding sounds and particle effects. Right-click to charge, release to fire, with a cooldown to prevent spam. Works in both survival and creative modes, appears in the creative inventory, and is obtainable via /give command. No skins, zoom, or complex state machines are included in this initial phase.
Set up the Fabric 1.21.11 project and GeckoLib dependency.
Implement the registered railgun and its charge/release behavior.
Add safe client-side GeckoLib rendering, animation resources, and sounds.
Created the Orbital Railgun Fabric project with GeckoLib item rendering, idle/aim/charge/fire animations, creative combat-tab registration, right-click charging, release-to-fire, a 64-block ray, impact particles, damage, and cooldown. The renderer is created lazily from the client entrypoint.
The railgun texture is generated during the build. Its custom sound events use vanilla audio cues; separate .ogg files were not added.
I couldn’t run ./gradlew clean build or provide a compiled JAR, so the build and in-game checklist remain unverified.
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
18 609
src/main/java/com/krazaq/orbitalrailgun/OrbitalRailgun.java
package com.krazaq.orbitalrailgun;
import net.fabricmc.api.ModInitializer;
public final class OrbitalRailgun implements ModInitializer {
public static final String MOD_ID = "orbital_railgun";
@Override
public void onInitialize() {
ModSounds.initialize();
ModItems.initialize();
}
}