Develop a superhero mod featuring three distinct hero classes, each with unique abilities and skills. Include high-quality particle effects for powers, custom textures for each superhero outfit, and a progression system that allows players to unlock advanced abilities. Ensure compatibility with existing Minecraft mechanics and provide a configuration file for customizing hero stats and effects.
KodariApr 17 at 7:53 pm 54,810 (v2)
SuperheroMod
A Fabric 1.21.4 mod adding three playable superhero classes: Speedster, Elementalist, and Titan. Each class has unique active and passive abilities unlocked through a progression system. Abilities feature custom particle effects and sounds. Players equip hero suits (custom armor) with class-specific textures. A config file controls hero stats, cooldowns, and XP thresholds. Abilities are activated via keybinds and tracked with a HUD overlay.
Let me read all required documentation before writing a single line of code.
SuperheroMod
A Fabric 1.21.4 mod adding three playable superhero classes: Speedster, Elementalist, and Titan. Each class features three unique active abilities unlocked through an XP progression system earned by defeating mobs. Hero suits provide passive buffs and abilities use vivid particle effects and sounds. Three keybinds activate abilities with configurable cooldowns. A HUD overlay shows class, XP, and ability cooldowns. A JSON config controls all stats, cooldowns, and XP thresholds.
Here’s my plan before writing any code:
Three hero classes (Speedster, Elementalist, Titan) each with 3 tiered abilities, tracked via Data Attachments API
Items: 3 selector crystals (right-click to choose class) + 3 hero suits (equippable chestplates for passives)
Networking: ActivateAbilityPayload (C2S) + HeroSyncPayload (S2C with 8 fields) using PacketCodec.tuple
Client: Keybinds (R/F/G), HUD via HudRenderCallback, ClientHeroData state class
No mixins needed — all logic via Fabric event callbacks
The mod is fully built with all files in place. Here’s a summary of what was created:
Core systems — HeroClass/HeroAbility enums define the three classes and their 9 abilities; HeroAttachments stores class, XP, and 3 cooldowns per player using the Data Attachments API (class/XP persist through death, cooldowns are volatile); HeroManager drives all server logic via ServerTickEvents and ServerEntityCombatEvents.
Abilities — Speedster: Dash (velocity burst), Time Slow (Slowness III AOE), Lightning Aura (strikes all nearby); Elementalist: Fireball (fire + damage AOE), Ice Nova (Slowness + Blindness), Storm Call (6 positioned lightning strikes); Titan: Shockwave (knockback + damage), Iron Skin (Resistance III + Regen + Absorption), Ground Slam (massive knockback + damage ring).
Networking — ActivateAbilityPayload (C2S, 1 int) carries keybind presses to server; HeroSyncPayload (S2C, 8 fields via PacketCodec.tuple) syncs class, XP, and all cooldown/max-cooldown values every 10 ticks.
Client — Keybinds R/F/G send ability packets; HeroHudRenderer draws class name, a color-coded XP bar (cyan for tier 1, purple for tier 2), and 3 ability bars showing green (ready), red (cooldown w/ seconds), or grey (XP locked) states.
Config — superheromod.json in the config dir lets server admins tune XP thresholds, all 3 cooldowns, ability range, damage values, and speed level with live config read per ability use.
The compilation failed with this error:
code
Compilation failed with 2 error(s):
ERROR in src/main/java/com/superheromod/hero/HeroManager.java at line 17: package net.minecraft.entity.type does not exist
import net.minecraft.entity.type.EntityType;
^
ERROR in src/main/java/com/superheromod/hero/HeroManager.java at line 17: package net.minecraft.entity.type does not exist
import net.minecraft.entity.type.EntityType;
^
=== COMPILATION ERROR ANALYSIS ===
FILES TO INVESTIGATE:
- src/main/java/com/superheromod/hero/HeroManager.java
- src/main/java/com/superheromod/hero/HeroManager.java
Please fix this error by creating a new artifact with the corrected code.
KodariApr 17 at 7:55 pm 5,684 (v2)
The import is wrong — EntityType lives in net.minecraft.entity, not net.minecraft.entity.type.
Fixed the incorrect package path: net.minecraft.entity.type.EntityType → net.minecraft.entity.EntityType.
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
43 1,214
src/main/java/com/superheromod/SuperheroMod.java
package com.superheromod;
import com.superheromod.config.ConfigManager;
import com.superheromod.hero.HeroAttachments;
import com.superheromod.hero.HeroManager;
import com.superheromod.item.ModItemGroups;
import com.superheromod.item.ModItems;
import com.superheromod.network.ModNetworking;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SuperheroMod implements ModInitializer {
public static final String MOD_ID = "superheromod";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
@Override
public void onInitialize() {
ConfigManager.load();
HeroAttachments.initialize();
ModItems.initialize();
ModItemGroups.initialize();
ModNetworking.initialize();
HeroManager.initialize();
LOGGER.info("SuperheroMod initialized.");
}
}