mrshivayayt
📎 1 file 9,567 chars
📄
pasted-code-1791879882003.txt
txt 223 lines
▶
# Minecraft Fabric 1.21.11 — Nine Elemental Sticks Mod

## Project Requirements
Create a complete, working Minecraft Fabric mod for **Minecraft Java Edition 1.21.11** using the correct Fabric Loader, Fabric API, Java version, and Yarn or Mojang mappings compatible with this version.

The mod must add **9 unique Elemental Sticks**, each with its own special ability, visual effects, sound effects, cooldown, and crafting recipe.

The mod must work on a multiplayer Fabric server and must not depend on Bukkit, Spigot, Paper, or Forge.

## 1. Lightning Stick ⚡
**Ability: Lightning Strike**

- When the player right-clicks while holding the stick, summon a lightning bolt at the block or entity targeted by the player's crosshair.
- Maximum targeting distance: 25 blocks.
- If targeting an entity, strike that entity's location.
- If targeting a block, strike just above the targeted block.
- Deal 8 hearts of damage to nearby hostile targets, subject to Minecraft's normal damage mechanics.
- Create lightning particles and a thunder sound.
- Cooldown: 8 seconds.
- Prevent the ability from repeatedly activating while the right mouse button is held.

## 2. Fire Stick 🔥
**Ability: Flame Burst**

- Right-click to create an explosion-like burst of fire at the targeted location.
- Range: 20 blocks.
- Deal fire damage to nearby hostile mobs.
- Ignite affected hostile mobs for 5 seconds.
- Spawn flame and smoke particles with a fire sound.
- Do not destroy blocks or create terrain damage.
- Cooldown: 8 seconds.

## 3. Water Stick 🌊
**Ability: Water Surge**

- Right-click to launch a powerful wave of water toward the targeted location.
- Push nearby hostile mobs away from the impact point.
- Deal moderate damage and apply Slowness for 4 seconds.
- Create splash particles and water sounds.
- Do not permanently flood the world or destroy blocks.
- Cooldown: 7 seconds.

## 4. Earth Stick 🪨
**Ability: Earthquake**

- Right-click to create a ground shockwave around the targeted location.
- Affect hostile mobs within a 6-block radius.
- Deal moderate damage and apply Slowness for 3 seconds.
- Create block-crack particles, dust particles, and a rumbling sound.
- Do not permanently modify terrain.
- Cooldown: 10 seconds.

## 5. Wind Stick 🌪️
**Ability: Wind Gust**

- Right-click to unleash a powerful gust toward the targeted location.
- Knock hostile mobs backward and slightly upward.
- Push nearby entities away from the impact point.
- Create cloud particles and a strong wind sound.
- Do not cause fall damage directly through the ability.
- Cooldown: 6 seconds.

## 6. Ice Stick ❄️
**Ability: Frost Nova**

- Right-click to release an icy blast around the targeted location.
- Freeze or slow hostile mobs within a 6-block radius.
- Apply Slowness for 5 seconds.
- Deal moderate ice-themed damage.
- Create snowflake-like particles and a freezing sound.
- Do not permanently freeze water or modify terrain.
- Cooldown: 8 seconds.

## 7. Nature Stick 🌿
**Ability: Nature's Wrath**

- Right-click to summon magical roots beneath nearby hostile mobs.
- Immobilize affected mobs briefly using a movement-restricting effect or suitable custom mechanic.
- Deal moderate damage.
- Create green particles, leaf particles, and a magical nature sound.
- The effect must expire automatically after 4 seconds.
- Do not permanently change the landscape.
- Cooldown: 9 seconds.

## 8. Shadow Stick 🌑
**Ability: Shadow Rift**

- Right-click to teleport the player to a safe location near the targeted point, up to 15 blocks away.
- Search for a safe landing position and prevent teleportation inside solid blocks, into lava, or into the void.
- Create dark particles at both the departure and arrival locations.
- Play a mysterious teleport sound.
- If no safe destination exists, cancel the ability and display a message.
- Cooldown: 10 seconds.

## 9. Light Stick ☀️
**Ability: Holy Burst**

- Right-click to release a burst of magical light at the targeted location.
- Damage hostile mobs within a 6-block radius.
- Apply Glowing to affected hostile mobs for 6 seconds.
- Create bright particles and a magical chime sound.
- Optionally heal the caster by 2 hearts, with proper health limits.
- Cooldown: 9 seconds.

# Item Design and Identification

Each stick must have:
- A unique item name and description in its tooltip.
- A unique texture and color scheme.
- A visible cooldown indicator or remaining cooldown message.
- A distinct ability activation sound.
- Appropriate particles matching its element.
- A unique item identifier so the nine sticks can never be confused with each other.

Use custom item models and textures if practical. If the resource pack is required for custom models, include it with the project and document how to install it.

Do not identify the sticks using their display names alone. Use unique registered items or reliable custom item data.

# Activation System

- All nine sticks activate through right-click.
- Use the server to validate and execute abilities.
- Prevent abilities from activating when the player is on cooldown.
- Show a clear message such as "Lightning Stick is ready in 4 seconds!" when an ability is still cooling down.
- Use a configurable targeting distance for each ability.
- Correctly handle targeting blocks, entities, and empty space.
- Ensure abilities do not repeatedly trigger every tick.
- Add configurable friendly-fire behavior and prevent accidental damage to the caster.
- Allow server owners to configure damage, cooldowns, ranges, and effects.

# Crafting Recipes

Create a different, balanced crafting recipe for each of the nine sticks.

Each recipe must:
- Use vanilla Minecraft materials and, where appropriate, Nether or End materials.
- Reflect the element and strength of the ability.
- Be unique to that stick.
- Be registered in the proper recipe format for Minecraft 1.21.11.
- Appear in the recipe book after the player unlocks it.
- Have a recipe unlock mechanism or command that grants the correct recipe knowledge.

Suggested materials:
- Lightning: Lightning Rod, Copper, Amethyst Shard.
- Fire: Blaze Rod, Magma Cream, Blaze Powder.
- Water: Heart of the Sea, Prismarine Shard, Nautilus Shell.
- Earth: Obsidian, Iron Ingot, Stone.
- Wind: Breeze Rod, Feather, Phantom Membrane.
- Ice: Packed Ice, Blue Ice, Snowball.
- Nature: Moss Block, Vine, Emerald.
- Shadow: Echo Shard, Ender Pearl, Obsidian.
- Light: Glowstone, Sea Lantern, Nether Star.

Balance the recipes so that stronger abilities require rarer ingredients. Do not make every stick use the same recipe.

# Commands

Implement the following working commands:

/elemental help
Displays all commands and a brief explanation of each stick.

/elemental give  
Gives the specified player the selected elemental stick.

/elemental giveall 
Gives all nine elemental sticks to the specified player.

/elemental list
Lists all nine sticks and their abilities.

/elemental cooldown   reset
Resets the selected stick's cooldown.

/elemental reload
Reloads the mod's configurable settings where supported.

Add tab completion for player names, elements, and subcommands.

Only server operators or players with an explicitly granted permission may use administrative commands. Regular players must not be able to give themselves items or bypass permissions.

# Configuration

Generate a configuration file containing:
- Damage per stick.
- Ability cooldowns.
- Targeting ranges.
- Area-of-effect radius.
- Player damage enabled/disabled.
- Friendly fire enabled/disabled.
- Particle and sound effects enabled/disabled.
- Individual abilities enabled/disabled.

Validate configuration values to prevent crashes or unreasonable values.

# Technical Requirements

1. Build a complete Fabric mod project, not a Bukkit plugin.
2. Register all nine items correctly for Minecraft 1.21.11.
3. Use the correct item interaction APIs for the target version.
4. Ensure server-authoritative ability execution for multiplayer.
5. Include all Java source files, Gradle files, Fabric metadata, resources, item definitions, recipes, and configuration files.
6. Avoid obsolete methods, incompatible dependencies, and incorrect recipe JSON formats.
7. Prevent crashes caused by null targets, unloaded chunks, invalid locations, or missing entities.
8. Ensure cooldowns are tracked separately for each player and each elemental stick.
9. Persist only the data that needs to survive a restart.
10. Avoid excessive particle spawning or expensive operations that could lag the server.

# Final Testing and Delivery

Before declaring the mod complete:

- Compile the project successfully.
- Test all nine abilities in single-player and on a dedicated multiplayer Fabric server.
- Test every stick's recipe and recipe-book unlock.
- Verify that each cooldown works independently.
- Verify that no ability causes unwanted permanent terrain damage.
- Verify that permissions and commands work correctly.
- Fix all compilation errors and runtime exceptions.

Deliver the complete source project and a compiled .jar file that works on Fabric 1.21.11. Include installation instructions and a README explaining every ability, recipe, command, and configuration option.

Do not provide placeholder abilities, fake commands, incomplete code, or a JAR that has not been built successfully.
Kodari AI
KodariOct 13 at 9:16 am 38
NineElementalSticks
A Fabric mod for Minecraft 1.21.11 adding nine unique elemental sticks (Lightning, Fire, Water, Earth, Wind, Ice, Nature, Shadow, Light), each with distinct right-click abilities, cooldowns, particles, sounds, and crafting recipes. Features server-authoritative ability execution, per-player cooldown tracking, configurable settings, administrative commands with tab completion, and comprehensive documentation. Includes full Gradle build setup, custom item textures, and recipe book integration.
  1. Scaffold the Fabric 1.21.11 project and register nine distinct craftable elemental sticks.

  2. Implement server-authoritative targeting, per-player cooldowns, configurable effects, and safe ability behavior.

  3. Add operator-gated commands, configuration, item resources, and usage documentation.

Created the Fabric 1.21.11 source project with nine registered sticks, individual recipes, a creative tab, tooltips, server-side abilities and cooldowns, operator-gated commands, a generated properties config, and a README.

Each stick is craftable in survival: Lightning uses a Lightning Rod, Copper Ingots, Amethyst Shard, and Stick; Fire uses Blaze Rods, Magma Cream, and Blaze Powder; Water uses Heart of the Sea, Prismarine Shards, Nautilus Shells, and Stick; Earth uses Obsidian, Iron Ingot, Stone, and Stick; Wind uses Breeze Rod, Feather, Phantom Membranes, and Stick; Ice uses Packed Ice, Blue Ice, Snowball, and Stick; Nature uses Moss Blocks, Vines, Emerald, and Stick; Shadow uses Echo Shard, Ender Pearls, Obsidian, and Stick; Light uses Glowstone, Sea Lanterns, Nether Star, and Stick.

Seven sticks have custom 64×64 icons. Nature and Shadow use vanilla Emerald and Echo Shard icons because texture-generation credits were unavailable.

The project has not been compiled or tested here, so I can’t claim a verified JAR. To build and download it in Kodari: click Compile, click Compile in the window, then Download when it succeeds. If it fails, use Auto-fix or Fix. Install the resulting JAR on the Fabric server and each client, with Fabric API for Minecraft 1.21.11.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
README.md
settings.gradle
Code
39 1,138
src/main/java/com/kodari/elementalsticks/ElementalSticksMod.java
package com.kodari.elementalsticks;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

import java.util.EnumMap;
import java.util.Map;

public class ElementalSticksMod implements ModInitializer {
    public static final String MOD_ID = "elementalsticks";
    public static final Map<ElementalType, ElementalStickItem> ITEMS = new EnumMap<>(ElementalType.class);

    @Override
    public void onInitialize() {
        ElementalConfig.load();

        for (ElementalType type : ElementalType.values()) {
            RegistryKey<Item> key = RegistryKey.of(RegistryKeys.ITEM, Identifier.of(MOD_ID, type.itemId()));
            ElementalStickItem item = new ElementalStickItem(type, new Item.Settings().registryKey(key));
            ITEMS.put(type, Registry.register(Registries.ITEM, key, item));
        }

        RegistryKey<ItemGroup> groupKey = RegistryKey.of(RegistryKeys.ITEM_GROUP, Identifier.of(MOD_ID, "elemental_sticks"));
        ItemGroup group = FabricItemGroup.builder()
                .displayName(Text.translatable("itemGroup.elementalsticks.elemental_sticks"))
                .icon(() -> new ItemStack(ITEMS.get(ElementalType.LIGHTNING)))
                .entries((displayContext, entries) -> ITEMS.values().forEach(entries::add))
                .build();
        Registry.register(Registries.ITEM_GROUP, groupKey, group);

        ElementalCommands.register();
    }
}