wolfiearts.
📎 1 file 3,818 chars
📄
pasted-code-1780981342009.txt
txt 48 lines
▶
Create a complete, well-structured, production-ready Fabric mod for Minecraft 1.21.11 named “CommandMagic”. Package name: net.commandmagic. The mod adds a survival-friendly magic system that lets players use vanilla Minecraft commands as spells using a Wand, a Spell Book, and a Spell Slab. Everything must work in survival and hardcore with cheats disabled (the mod internally grants permission for spell commands).
Core Goal: Make commands feel like real magic while teaching players command usage. No mana, XP, or fuel costs. Progression comes from crafting the items and learning commands.
1. Wand (Early-game item)
•  Crafting Recipe:
	•  Top-center: Amethyst Shard
	•  Middle-center: Stick
	•  All other slots empty
•  Usage:
	•  Right-click while holding the wand and no Spell Book in off-hand → Opens a custom magical INVENTORY INVENTORY GUI.
	•  INVENTORY INVENTORY GUI Details: Dark mystical background with floating glowing runes, symbols, and orbiting particles. Single-line text input field in the center.
	•  Full vanilla-style command autocomplete, argument suggestions, and hover help text (exactly like chat or command blocks).
	•  Enter key → Executes the command immediately.
	•  Escape key → Closes INVENTORY INVENTORY GUI but keeps the typed text for the next opening (useful for /clone, /fill, etc.).
	•  After successful cast (Enter), next right-click opens with empty field.
2. Spell Book (Persistent spell storage)
•  Crafting Recipe:
	•  Middle row: Amethyst Shard | Book | Amethyst Shard
	•  All other slots empty
•  Usage:
	•  Right-click while holding in main hand → Opens a book-style INVENTORY INVENTORY GUI (like a written book with glowing magical particles, runes, and enchantment effects).
	•  Infinite pages with next/previous buttons.
	•  Each page has a customizable name/title and supports one or multiple commands (executed in sequence).
	•  Escape = close without executing.
•  Off-hand Combo (Book in off-hand + Wand in main hand):
	•  Right-click wand → Instantly executes current page’s command(s).
	•  Sneak + mouse wheel scroll → Cycle pages (show page name).
	•  Sneak + right-click (book stays in off-hand) → Opens book INVENTORY INVENTORY GUI for editing.
3. Spell Slab (Survival-friendly directional command block)
•  Crafting Recipe:
	•  Middle row: Amethyst Shard | Amethyst Shard | Amethyst Shard
	•  Bottom row: Stone Slab | Stone Slab | Stone Slab
•  Block Properties: Slab block, directional (north, south, east, west).
•  Activation:
	•  Right-click or redstone pulse → Executes once (Impulse mode).
	•  Toggleable to Repeating mode (loops until turned off by right-click or redstone).
•  Editing: Sneak + right-click → Opens custom magical INVENTORY INVENTORY GUI (command-block style but with runes and particles).
	•  Supports single or multiple commands in sequence.
	•  Full autocomplete.
•  Chaining: After its commands finish, it triggers the next Spell Slab in the direction it faces (like vanilla command blocks).
General Requirements
•  Full vanilla command support with autocomplete for all three items/blocks.
•  Blacklisted commands: /gamemode (only allow survival and spectator), /ban, /kick, /gamerule, /difficulty, /stop, and similar dangerous commands.
•  Nice particles and sounds on INVENTORY INVENTORY GUI open and spell cast.
•  Persistent NBT saving for Spell Book pages and Spell Slab data.
•  Clean, well-commented code following Fabric best practices.
•  Generate the full project structure with all Java classes, GUIs (ScreenHandlers), event handlers, item/block registration, recipes, fabric.mod.json, and a basic README.md with recipes and usage instructions.
•  Make everything feel magical and polished. Aim for stable, working code on first generation.
Generate the complete mod now.
Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code