TONI's Magic Lib

Magic engine for TONI's mods: spell registry, wands with mana, spell tomes, spell projectiles, ready-made spell effects, light and dark sides, spellcaster mobs and cast events.

TONI's Magic Lib is the magic engine behind TONI's Wizardry. It adds nothing to the game on its own: install it when a mod asks for it.

It gives magic mods one shared system for spells, mana, wands, tomes, spell projectiles, sides and spellcasting mobs, so every TONI's magic mod plays the same way and works together.

What it provides

  • Spell registry: spells are registered with an id (mymod:fireball), mana cost, cooldown, colour, minimum wand tier, and a cast action. Mob-only spells are supported too.
  • Wands and staffs (WandItem): a tier (spell power), their own mana pool that refills while carried (shown as a blue bar), the spells inscribed in them, and the selected spell. Right-click casts, sneak + right-click switches spell.
  • Spell tomes (SpellTomeItem): used with a wand in the other hand, they inscribe their spell into it.
  • Mana potions (ManaPotionItem): refill every wand the player carries.
  • Spell orbs: one glowing projectile entity for every projectile spell, with pluggable behaviours. Ready-made: a homing arcane bolt, a fireball and an explosive meteor.
  • Ready-made spell effects: projectile, frost nova, lightning, blink, heal, shield, life drain, meteor rain and raise dead. A whole spell is one line.
  • Sides: a light side (players, villagers, iron golems, pets, good casters) and a dark side (dark casters and their minions). Spells never hurt allies, and area spells only hit foes, never animals.
  • Spellcaster mobs (SpellcasterMob): a base mob with a side, variants, a staff in hand and a synced "casting" state with coloured sparks. It comes with AI goals: keep distance and cast (CastSpellGoal) and heal hurt allies (HealAlliesGoal).
  • Cast events: listeners before every cast (they can cancel it) and after it.
  • Commands: /tonimagic spells lists every registered spell. /tonimagic fill and /tonimagic learnall (op) refill or teach the wand in your hand.
  • Config config/tonimagic.properties: mana refill speed and spell damage multipliers for players and for mobs. They apply to every mod that uses the lib.
  • English and Spanish.

For modders

A spell is one statement:

Spell FIREBALL = Spell.builder("mymod:fireball").mana(15).cooldown(16).color(0xFF7A1A)
    .orb(OrbBehaviors.fire(6, null))
    .cast(c -> SpellEffects.projectile(c, 1.3, 0, 1))
    .register();

REG.item("fire_tome", p -> new SpellTomeItem(p, FIREBALL));
REG.item("oak_wand", p -> new WandItem(p, 1, 100, 4, FIREBALL.id()));

Names come from the lang keys spell.mymod.fireball and spell.mymod.fireball.desc. Packages: api (Spell, Spells, SpellContext, OrbBehavior, Factions, MagicEvents), cast (Casting, SpellEffects, OrbBehaviors), entity (SpellOrb, SpellcasterMob, ai), item.

Requirements

Join the Discord: discord.com/invite/4YAxqzxgBd

TONI's Magic Lib Team

profile avatar
  • 24
    Followers
  • 54
    Projects
  • 399.7K
    Downloads

Hi, I'm DGcuberX and I like creating mods!

More from Toni_Carter_Company_Mods_IncView all

  • TONI's Wizardry project image

    TONI's Wizardry

    Become a wizard: wands with their own mana, 9 spells from tomes (fireball, frost nova, lightning, meteor...), good and dark wizards, necromancers, and Dark Towers guarded by the Archwarlock boss.

    • 259
    • November 16, 2026
  • TONI's TNT Lib project image

    TONI's TNT Lib

    The engine of TNT Expansion: explosions, TNT blocks, dynamite and the TNT Workbench, for every Minecraft version.

    • 41.5K
    • November 16, 2026
  • Helicopters & Airplanes: A Toni Carter Aerial Mod project image

    Helicopters & Airplanes: A Toni Carter Aerial Mod

    Find oil, refine it into aviation fuel, and build an air force. Ten flyable helicopters and airplanes, from a two-seat trainer to a thirty-passenger airliner, backed by a full industrial chain that starts with a pickaxe and ends with a runway.

    • 5.6K
    • November 16, 2026
  • Realistic Walkie-Talkie project image

    Realistic Walkie-Talkie

    Tango-Oscar-November-India; Walkie-talkies for Simple Voice Chat: tune a frequency and talk to everyone on it, with radio sound, beeps, signal bars and a clean HUD.

    • 6.5K
    • November 16, 2026
  • TONI's Wizardry project image

    TONI's Wizardry

    Become a wizard: wands with their own mana, 9 spells from tomes (fireball, frost nova, lightning, meteor...), good and dark wizards, necromancers, and Dark Towers guarded by the Archwarlock boss.

    • 259
    • November 16, 2026
  • TONI's TNT Lib project image

    TONI's TNT Lib

    The engine of TNT Expansion: explosions, TNT blocks, dynamite and the TNT Workbench, for every Minecraft version.

    • 41.5K
    • November 16, 2026
  • Helicopters & Airplanes: A Toni Carter Aerial Mod project image

    Helicopters & Airplanes: A Toni Carter Aerial Mod

    Find oil, refine it into aviation fuel, and build an air force. Ten flyable helicopters and airplanes, from a two-seat trainer to a thirty-passenger airliner, backed by a full industrial chain that starts with a pickaxe and ends with a runway.

    • 5.6K
    • November 16, 2026
  • Realistic Walkie-Talkie project image

    Realistic Walkie-Talkie

    Tango-Oscar-November-India; Walkie-talkies for Simple Voice Chat: tune a frequency and talk to everyone on it, with radio sound, beeps, signal bars and a clean HUD.

    • 6.5K
    • November 16, 2026