arielf2019

Develop a Minecraft 1.21.4 mod featuring six unique gems, each granting a distinct superpower when collected. The first gem, the Power Gem (red), allows players to unleash a powerful melee hit and a damaging explosive blast with a 15-second cooldown; include unique key bindings for each gem's abilities. Design five additional gems with varied powers such as speed boosts, elemental attacks, shield generation, healing abilities, and invisibility, ensuring polished visuals and effects for a captivating gameplay experience.

Kodari AI
KodariApr 21 at 8:44 am 27,733 (v2)

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

GemsOfPower
A Fabric 1.21.4 mod adding six unique gemstones, each granting a distinct superpower. Power Gem (red) unleashes an AOE melee slam and explosive blast. Speed Gem (yellow) triggers a speed and jump surge. Soul Gem (teal) fires a frost lance that slows enemies. Shield Gem (orange) generates a force shield with resistance and absorption. Life Gem (green) emits a healing wave with regeneration. Shadow Gem (purple) grants invisibility and swiftness. All abilities use dedicated keybinds with a 15-second cooldown.

Now writing every file from scratch โ€” no patches, no updates.


Hereโ€™s a full breakdown of what was built:

Architecture (26 files):

  • GemAbilityPayload โ€” C2S CustomPayload record registered via PayloadTypeRegistry.playC2S(), carries a single String abilityId so any gemโ€™s ability can ride the same packet channel

  • CooldownManager โ€” thread-safe HashMap<UUID, Map<String, Long>> tracking expiry timestamps using System.currentTimeMillis(); shared by all 7 abilities

  • GemAbilityHandler โ€” validates gem presence (inventory scan) and cooldown before routing to each static ability method; Power Melee does 8-damage AoE 5-block sphere with knockback vectors; Power Blast deals 12-damage in 8 blocks with EXPLOSION_EMITTER particle; Frost Lance dot-products the playerโ€™s look vector against nearby entities to find a crosshair target and applies Slowness + Weakness; Force Shield grants Resistance II + Absorption IV + Fire Resistance; Healing Wave calls player.heal(10f) + Regeneration III; Vanish applies Invisibility + Speed + Night Vision

  • GemKeybindings โ€” registers 7 KeyBindings (Z/X/C/V/B/N/M, custom category) via KeyBindingHelper and polls wasPressed() each END_CLIENT_TICK, firing ClientPlayNetworking.send() packets

  • All items use mandatory registryKey() on Item.Settings, all have 1.21.4-compliant items/<gem>.json definition files; gems are added to the COMBAT group via ItemGroupEvents

Note: Place 16ร—16 PNG textures at src/main/resources/assets/gemsofpower/textures/item/<gem_name>.png for each gem to display correctly in-game.

arielf2019

how do i get them?

Kodari AI
KodariApr 21 at 8:48 am 2,567 (v2)

How to Get the Gems In-Game

Since no crafting recipes or world generation were added, you have two ways to get them right now:


โœ… Option 1 โ€” Creative Mode (Instant)

  1. Open your inventory in Creative Mode

  2. Search for โ€œGemโ€ in the search tab

  3. All 6 gems will appear โ€” drag them into your hotbar


โœ… Option 2 โ€” Give Command (Survival Testing)

Plain Text
/give @s gemsofpower:power_gem
/give @s gemsofpower:speed_gem
/give @s gemsofpower:soul_gem
/give @s gemsofpower:shield_gem
/give @s gemsofpower:life_gem
/give @s gemsofpower:shadow_gem

๐ŸŽฎ Once You Have a Gem

Make sure itโ€™s anywhere in your inventory (not just hotbar), then use these keys:

Key
Gem
Ability
Z
Power Gem ๐Ÿ”ด
Melee Slam
X
Power Gem ๐Ÿ”ด
Explosive Blast
C
Speed Gem ๐ŸŸก
Speed Surge
V
Soul Gem ๐Ÿฉต
Frost Lance
B
Shield Gem ๐ŸŸ 
Force Shield
N
Life Gem ๐ŸŸข
Healing Wave
M
Shadow Gem ๐ŸŸฃ
Vanish

๐Ÿ’ก Want me to add crafting recipes or natural world generation (ore/chest loot) so you can obtain them in survival mode properly?

arielf2019

how do i add this to the game?

Kodari AI
KodariApr 21 at 8:49 am 2,187 (v2)

How to Add the Mod to Your Game

Step 1 โ€” Prerequisites

Make sure you have these installed:

  • Java 21 (required for 1.21.4)

  • Fabric Loader for Minecraft 1.21.4

  • Fabric API mod in your mods folder


Step 2 โ€” Build the Mod

  1. Open a terminal/command prompt in the projectโ€™s root folder

  2. Run:

    • Windows: gradlew build

    • Mac/Linux: ./gradlew build

  3. Wait for it to say BUILD SUCCESSFUL

  4. Your .jar file will be inside /build/libs/

    • Use the one without -sources in the name


Step 3 โ€” Install It

  1. Copy that .jar file

  2. Paste it into your Minecraft mods folder:

    • Windows: %appdata%\.minecraft\mods

    • Mac: ~/Library/Application Support/minecraft/mods

    • Linux: ~/.minecraft/mods


Step 4 โ€” Launch

  1. Open the Minecraft Launcher

  2. Select your Fabric 1.21.4 profile

  3. Hit Play


โš ๏ธ Common Issues

Problem
Fix
BUILD FAILED
Make sure you have Java 21 set as your JDK
Mod not showing
Double-check Fabric API is also in your mods folder
Crash on launch
Confirm your Fabric Loader version supports 1.21.4

๐Ÿ’ก You can also run it directly from the project using gradlew runClient to launch a test Minecraft instance without copying anything!

arielf2019

can you add a way to download it using gradlew

Kodari AI
KodariApr 21 at 9:00 am 2,719 (v2)

Building the Mod with Gradlew

You donโ€™t โ€œdownloadโ€ with gradlew, but you build the mod into a .jar file you can install. Hereโ€™s how:


โœ… Step 1 โ€” Open a Terminal

Navigate to your modโ€™s root folder (where build.gradle is located)


โœ… Step 2 โ€” Run the Build Command

Windows:

Plain Text
gradlew build

Mac / Linux:

Plain Text
./gradlew build

โœ… Step 3 โ€” Find Your JAR

Once it finishes, your mod JAR will be at:

Plain Text
build/libs/gemsofpower-1.0.0.jar

Ignore the -sources.jar file, you only need the plain one


โœ… Step 4 โ€” Install It

  1. Copy the .jar into your .minecraft/mods/ folder

  2. Make sure you have Fabric Loader and Fabric API installed

  3. Launch Minecraft with the Fabric profile


โš ๏ธ First Time Only

If itโ€™s your first build, gradlew will download all dependencies automatically โ€” this can take a few minutes depending on your internet speed


๐Ÿ’ก Want me to add crafting recipes or ore generation so you can obtain the gems in survival mode?

arielf2019

i have the gems but the dont have a texture and they dont work fix it.

Kodari AI
KodariApr 22 at 5:25 pm 65,963 (v2)

Let me read every file before touching anything.

Now read all the JSON resource files:

Now I need to check the rendering docs to handle the dynamic texture generation, since PNG files are missing:

[Generation stopped]

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
25 646
src/main/java/com/gemsofpower/GemsOfPower.java
package com.gemsofpower;

import com.gemsofpower.network.GemAbilityPayload;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.minecraft.item.ItemGroups;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class GemsOfPower implements ModInitializer {

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

    @Override
    public void onInitialize() {
        ModItems.initialize();

        PayloadTypeRegistry.playC2S().register(GemAbilityPayload.ID, GemAbilityPayload.CODEC);

        ServerPlayNetworking.registerGlobalReceiver(GemAbilityPayload.ID, (payload, context) -> {
            ServerPlayerEntity player = context.player();
            if (!(player.getWorld() instanceof ServerWorld serverWorld)) return;
            GemAbilityHandler.handleAbility(payload.abilityId(), player, serverWorld);
        });

        ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> {
            entries.add(ModItems.POWER_GEM);
            entries.add(ModItems.SPEED_GEM);
            entries.add(ModItems.SOUL_GEM);
            entries.add(ModItems.SHIELD_GEM);
            entries.add(ModItems.LIFE_GEM);
            entries.add(ModItems.SHADOW_GEM);
        });
    }
}