Can you make a custom weapon mod for Minecraft 1.21.4
I’ll create a custom weapon mod for Minecraft 1.21.4 with multiple unique weapons.
Perfect! I’ve created a complete custom weapon mod for Minecraft 1.21.4 Fabric with the following features:
Weapons Included:
Ruby Sword - 25% chance to apply Weakness effect with particle effects
Obsidian Battleaxe - High damage axe with 30% chance to apply Slowness
Celestial Blade - Epic rarity sword that applies Glowing + Levitation to enemies and gives Regeneration + Speed to the wielder
Flame Dagger - Sets enemies on fire with every hit
Thunder Spear - Throwable weapon with electric spark effects
Material System:
Three custom tool materials (Ruby, Obsidian, Celestial) with increasing durability and power
Proper repair materials using item tags
Key 1.21.4 Features:
Mandatory RegistryKey implementation for all items
Item model definition files in the new format
Proper particle and sound effects using 1.21.4 APIs
Custom item group with all weapons
Status effect applications on hit
Next Steps:
Add texture PNG files to
src/main/resources/assets/customweapons/textures/item/for each weaponRun
./gradlew buildto compileThe mod will appear in
build/libs/
All weapons have unique special effects that trigger on hitting enemies, with particles and sounds to match their theme!
Add texture packs on your own from the internet
I cannot download or fetch texture files from the internet. I don’t have the ability to browse websites or access external resources.
However, I can help you in these ways:
What I CAN do:
Create the proper file structure for textures in your mod
Explain where to place textures you download or create yourself
Show you where to find free textures:
OpenGameArt.org - Free game assets
Create your own using tools like:
Paint.NET (free)
GIMP (free)
Aseprite (paid, but great for pixel art)
Blockbench (free, includes texture editor)
Create placeholder textures - I can generate simple colored placeholder PNGs if you need temporary textures to test your mod
What YOU need to do:
Create or download 16x16 PNG textures for your items
Place them in
src/main/resources/assets/customweapons/textures/item/Name them to match your item IDs:
ruby.pngruby_sword.pngcelestial_blade.pngflame_dagger.pngthunder_spear.pngobsidian_battleaxe.pngcelestial_crystal.pngobsidian_shard.png
Would you like me to:
Create simple placeholder texture files so your mod works immediately?
Explain how to create your own textures?
Show you the exact folder structure you need?
The compilation failed with this error:
Validation failed for compilation: Compilation failed with 2 error(s):
ERROR in src/main/java/com/customweapons/item/ThunderSpearItem.java at line 8: cannot find symbol
import net.minecraft.item.ToolMaterials;
^
symbol: class ToolMaterials
location: package net.minecraft.item
ERROR in src/main/java/com/customweapons/item/ThunderSpearItem.java at line 8: cannot find symbol
import net.minecraft.item.ToolMaterials;
^
symbol: class ToolMaterials
location: package net.minecraft.item
=== COMPILATION ERROR ANALYSIS ===
MISSING CLASSES:
- ToolMaterials
ACTION: Create these classes or check imports
FILES TO INVESTIGATE:
- src/main/java/com/customweapons/item/ThunderSpearItem.java
- src/main/java/com/customweapons/item/ThunderSpearItem.java
exceeds maximum
Please fix this error by creating a new artifact with the corrected code.
I need to read the ThunderSpearItem file and related files to understand the issue and fix the import error.
I can see the issue. The ThunderSpearItem is trying to import ToolMaterials (vanilla materials enum) which doesn’t exist or has been removed in Minecraft 1.21.4. The other weapon items correctly accept a ToolMaterial parameter. Let me fix this:
Fixed the compilation error by replacing the non-existent ToolMaterials import with ToolMaterial and updating the constructor to accept a material parameter, matching the pattern used by other custom weapon items.
package com.customweapons;
import net.fabricmc.api.ClientModInitializer;
public class CustomWeaponsClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
CustomWeapons.LOGGER.info("Initializing Custom Weapons Client");
}
}