Fuller47

uses injections to give players powers from various superheroes which are created through centrifuges, injectors, etc. For example the older Lucraft:core mod

Kodari AI
KodariJun 29 at 8:55 pm 56
HeroInjector
A Fabric mod inspired by Lucraft: Core that lets players gain superhero powers through crafted injectors. Obtain biological samples, process them in a centrifuge block, and inject serums to unlock unique power sets. Each hero class (Speed, Strength, Flight, etc.) grants unique abilities, passive buffs, and active skills. Craft, upgrade, and lose powers through gameplay mechanics with full custom block, item, and effect systems.

Let me read the relevant docs before writing a single line of code.

HeroInjector
A Fabric 1.21.11 mod inspired by Lucraft: Core where players gain superhero powers through a centrifuge and injector system. Process vanilla items in the Centrifuge block to synthesize serums, then right-click to inject them. Four hero archetypes: Speedster (Speed + Haste), Titan (Strength + Resistance), Aerial (true creative flight via abilities), and Undead (Fire Resistance + Night Vision + Wither on hit). Powers persist as long-duration status effects.

Plan:

  1. Build files + fabric.mod.json

  2. Status effects (Speedster, Titan, Aerial, Undead) + ModEffects

  3. SerumItem + ModItems

  4. CentrifugeBlock + CentrifugeBlockEntity + ModBlocks + ModBlockEntities

  5. PowerEventHandler (flight ability management + wither-on-hit)

  6. HeroInjector main + HeroInjectorClient

  7. All resource files (models, items/, lang, blockstates, recipes)

Now all the resource files:


Hereโ€™s a full breakdown of how the mod works:

๐Ÿงฌ Centrifuge

Craft with 8 Iron Ingots + 1 Glass (3ร—3 ring). Right-click with a valid biological sample to insert it โ€” it processes over 10 seconds with smoke particles. Right-click with an empty hand to collect the serum when done. Breaking the block drops any inserted/processed items.

๐Ÿ’‰ Serums & Powers

Sample
Serum
Power (1 hour)
๐Ÿ•ท๏ธ Spider Eye
Speedster Serum
Speed III + Haste II
๐Ÿ‘ป Phantom Membrane
Aerial Serum
True creative flight + Slow Falling + Jump Boost III
โญ Nether Star
Titan Serum
Strength II + Resistance I
๐Ÿ’€ Wither Skeleton Skull
Undead Serum
Fire Resistance + Night Vision + Wither enemies on hit

Right-click a serum to instantly inject it. The Aerial power grants true allowFlying ability (same as creative mode flight), which is cleanly revoked when the effect expires โ€” handled server-tick by PowerEventHandler. The Undead wither-on-hit fires via ServerLivingEntityEvents.AFTER_DAMAGE.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
34 798
src/main/java/com/heroinjector/HeroInjector.java
package com.heroinjector;

import com.heroinjector.block.ModBlocks;
import com.heroinjector.block.entity.ModBlockEntities;
import com.heroinjector.effect.ModEffects;
import com.heroinjector.event.PowerEventHandler;
import com.heroinjector.item.ModItems;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class HeroInjector implements ModInitializer {

    public static final String MOD_ID = "heroinjector";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    @Override
    public void onInitialize() {
        ModEffects.initialize();
        ModItems.initialize();
        ModBlocks.initialize();
        ModBlockEntities.initialize();
        PowerEventHandler.register();
    }
}