Back to mods
Spell Lib project artwork

Modrinth · Minecraft mod

Spell Lib

Adds a bunch of spells for other projects to use, with customization. Makes projects that want to add spells easier to make, with any casting system.

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which Spell Lib release matches 1.21.8 Forge?

Updated last month
Best match for your filters v1.1+mod
Game version 1.21.5, 1.21.6, 1.21.7
Loader Fabric, Forge, NeoForge

Spell Lib v1.1+mod targets 1.21.5, 1.21.6, 1.21.7 with Fabric, Forge, NeoForge. Installation on the client is optional. Installation on the dedicated server is optional. No extra mods listed for this file.

Where it goes

Is Spell Lib required on the client, server, or both?

Installation on the client is optional. Installation on the dedicated server is optional.

Client Optional
Dedicated server Optional
Loader for this release Fabric, Forge, NeoForge
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source marks this as usable on both the client and server.

What else does Spell Lib v1.1+mod need?

v1.1+mod on 1.21.8 Forge. Every mod below is checked against that same setup.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add Spell Lib without breaking your instance.

Built for Spell Lib v1.1+mod on 1.21.8 Forge. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use v1.1+mod. It targets 1.21.5, 1.21.6, 1.21.7 with Fabric, Forge, NeoForge; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    Installation on the client is optional. Installation on the dedicated server is optional.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside v1.1+mod. It opens that exact file at the source.

About this project

What does Spell Lib add?

Warning

This is a library, not a content mod. It does not add gameplay functionality alone, and you will need to use commands or install a project that uses it to cast any of the spells it adds.

Description

Adds spells to the game, to aid creators of magic mods and datapacks. Works in vanilla, but there is no casting system built-in, as this is a library and meant to be a base for other projects, not used alone.


To use the spells:
Use /function spell_lib:spells/<spell> {<args>}

Spell list with testing examples

| description | :

  • sonic_boom | Makes a beam similar to the Warden's sonic boom attack. | owner, length, damage

/function spell_lib:spells/sonic_boom {owner:"@p",length:3,damage:5}

  • lightning_strike | Strikes lightning after a delay, giving particles as a warning. Take cover to protect you from the lightning. | target, time_until_strike, warning_period (the delay between bursts of particles)

/function spell_lib:spells/lightning_strike {target:"@p",time_until_strike:200,warning_period:10}

  • cloud_tp_and_invis | You vanish in a cloud of smoke and go invisible/teleport away from your location. | owner, tp, sound, radius, has_invis, invis_time

/function spell_lib:spells/cloud_tp_and_invis {owner:"@p",tp:true, sound:true,radius:10,has_invis:true,invis_time:3}

(updated in v1.0)

Using the library

If using the library, please add it as a dependency, whether your project is a datapack or mod. Do NOT just copy the files inside. Feel free to use as many of my spells as you want, and add an interesting, unique way to cast them. You can even use them in ways other than spells. Before using it, remember to understand how the command arguments work and interact. For example, it won't work with @s (even when you run it yourself) or a selector without quotes (owner:Name works, owner:@p doesn't work, owner:"@p" works). You also need to run the command with every argument, even if one like has_invis in cloud_tp_and_invis cancels out others (like invis_time). Try the example commands in the spell list to understand each one. Also note that using a spell will cancel out active spells of that type (for example, if one player casts lightning_strike then another casts it before the first player is struck, only the second player will get struck.) However, one command can target multiple entities (owner:"@e" will cast the spell as every entity, but they will all run at the same time and with the same settings.)
Since the library uses function macros, heavy use of spells may cause performance issues. If publishing a project using this, it would be helpful to mention this. Note that these macros are only run when spells are active, and not run every tick (updated in v1.0)

Versions

Supports Java Edition 1.21.5 - 26.2

Compatibility

Incompatible with anything with the same filenames. Test the commands in singleplayer before using them, to understand how the commands work.


Casting a second spell of the same type before one has ended will overwrite the old spell and transfer it to the new owner, target, or config.
Uses function macros. May affect performance, although I don't know the extent. Test it on the computer running the datapack, and try things such as many spells targetting many entities to determine the effects. If you're using the library, please add this disclaimer.

patreon-singular
discord-singular

Project description from Modrinth.

Pick your setup

Spell Lib by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

55 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

Spell Lib versions and loaders

1 of 4 releases match
Clear filters

Looking for an older file? The official Modrinth project page is in Resources.