spider_itachi1

Detailed Minecraft Fabric Mod specification and implementation blueprint for Java Edition.

Feature: Asta's Anti-Magic Transformation & Five-Leaf Clover Grimoire System.

  1. Custom Player Skin & Transformation State:

- Dynamic transformation trigger (Devil Form / Half-Demon mode). - Render custom overlay textures on player model: 1 black demon wing on the back, 1 black horn on the forehead, half-face black corrupt texture with glowing red right eye, and dark anti-magic body patches. - Smooth transformation particle effects (burst of black and crimson red particle cloud with pitch-black lightning around the player).

  1. Floating Five-Leaf Clover Grimoire (Book):

- Custom 3D block/entity model floating near the player when transformed. - Animated book opening/closing sequence with glowing red dark runes floating out of the pages.

  1. Anti-Magic Swords & Dynamic Draw Animations:

- Items: Demon-Slayer Sword and Demon-Dweller Sword. - Draw/Unsheathe Animation: Playing a custom particle trail (black smoke + red electric sparks) and motion arc when switching hotbar slot or pulling the sword out of the Grimoire. - Dynamic attack trail VFX and heavy impact sound effects.

Code stack: Java 17+, Fabric API, Geckolib / AzureLib for 3D animated models and item animations.

Kodari AI
KodariOct 15 at 9:31 pm 17
AstaAntiMagicGrimoire
Adds a transformation system enabling players to enter Asta's Devil Form with custom skin overlays including demon wings, horns, and glowing red eye. Features a floating five-leaf clover grimoire with animated opening sequences and glowing runes. Includes two anti-magic swords with dynamic draw animations, particle trails, and impact effects. Built with Fabric API and GeckoLib for 3D animated models and item rendering.
  1. Set up the Fabric 1.21.11 project and register the survival-obtainable grimoire and swords.

  2. Add a synchronized transformation toggle with its keybind and particle/audio effects.

  3. Add client-side transformation visuals and the floating, animated grimoire presentation.

  1. Added the Fabric 1.21.11 project scaffold, custom item icons, English names, and the swords and grimoire in the Combat creative tab.

  2. Press R to toggle transformation. The server synchronizes the state; clients show black-and-crimson particles and sound. While transformed, a floating grimoire item follows the player and is removed when transformation ends or the player disconnects.

  3. Switching to either sword or attacking with one creates a particle arc and plays a sword sound.

  4. Survival recipes: the grimoire uses paper around a book; the Demon-Slayer Sword uses obsidian, iron, a book, and a stick; the Demon-Dweller Sword uses iron, an ender pearl, a book, and a stick.

The custom wing, horn, face overlays, and an opening-page 3D grimoire still need model/animation assets. Create those in Kodari Studio (3D Models) and bring them into this project through a workspace; the current floating grimoire uses its item icon and vanilla item hover rather than those custom visuals.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
24 569
src/client/java/com/kodari/antimagic/client/AntiMagicClient.java
package com.kodari.antimagic.client;

import com.kodari.antimagic.AntiMagicMod;
import com.kodari.antimagic.network.TransformationPayload;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

import java.util.UUID;

public class AntiMagicClient implements ClientModInitializer {
    private static KeyBinding transformKey;
    private static int auraTicks;
    private static int previousSelectedSlot = -1;
    private static boolean attackWasPressed;

    @Override
    public void onInitializeClient() {
        KeyBinding.Category category = KeyBinding.Category.create(Identifier.of(AntiMagicMod.MOD_ID, "transform"));
        transformKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.antimagic.transform",
                InputUtil.Type.KEYSYM,
                GLFW.GLFW_KEY_R,
                category
        ));

        ClientPlayNetworking.registerGlobalReceiver(TransformationPayload.ID, (payload, context) -> {
            UUID playerUuid = UUID.fromString(payload.playerUuid());
            boolean changed = TransformationClientState.update(playerUuid, payload.transformed());
            MinecraftClient client = context.client();
            if (changed && client.world != null) {
                PlayerEntity player = client.world.getPlayerByUuid(playerUuid);
                if (player != null) {
                    TransformationEffects.playBurst(client.world, player, payload.transformed());
                }
            }
        });

        ClientTickEvents.END_CLIENT_TICK.register(AntiMagicClient::tick);
    }

    private static void tick(MinecraftClient client) {
        if (client.world == null) {
            TransformationClientState.clear();
            previousSelectedSlot = -1;
            attackWasPressed = false;
            auraTicks = 0;
            return;
        }

        if (client.player != null) {
            while (transformKey.wasPressed()) {
                boolean nextState = !TransformationClientState.isTransformed(client.player.getUuid());
                ClientPlayNetworking.send(new TransformationPayload("", nextState));
            }

            int selectedSlot = client.player.getInventory().getSelectedSlot();
            if (previousSelectedSlot != -1 && selectedSlot != previousSelectedSlot && isAntiMagicSword(client)) {
                TransformationEffects.emitSwordArc(client.world, client.player, false);
            }
            previousSelectedSlot = selectedSlot;

            boolean attackPressed = client.options.attackKey.isPressed();
            if (attackPressed && !attackWasPressed && isAntiMagicSword(client)) {
                TransformationEffects.emitSwordArc(client.world, client.player, true);
            }
            attackWasPressed = attackPressed;

            if (TransformationClientState.isTransformed(client.player.getUuid()) && ++auraTicks % 3 == 0) {
                TransformationEffects.emitAura(client.world, client.player);
            }
        }
    }

    private static boolean isAntiMagicSword(MinecraftClient client) {
        return client.player.getMainHandStack().isOf(com.kodari.antimagic.ModItems.DEMON_SLAYER_SWORD)
                || client.player.getMainHandStack().isOf(com.kodari.antimagic.ModItems.DEMON_DWELLER_SWORD);
    }
}