Cast Spells in Minecraft!
This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
TheBrokenRail 2f262b9cf4
All checks were successful
SorceryCraft/pipeline/head This commit looks good
1.1.1
Add a unique texture for the Spell
2020-03-08 17:50:44 -04:00
gradle/wrapper Update API Docs 2020-03-08 12:26:12 -04:00
src/main 1.1.1 2020-03-08 17:50:44 -04:00
.gitignore Initial Commit 2020-03-01 13:19:59 -05:00
build.gradle 1.0.9 2020-03-06 19:21:27 -05:00
CHANGELOG.md 1.1.1 2020-03-08 17:50:44 -04:00
gradle.properties 1.1.1 2020-03-08 17:50:44 -04:00
gradlew Initial Commit 2020-03-01 13:19:59 -05:00
gradlew.bat Initial Commit 2020-03-01 13:19:59 -05:00
Jenkinsfile Fix JAR Build 2020-03-01 21:45:16 -05:00
LICENSE Initial Commit 2020-03-01 13:19:59 -05:00
README.md 1.1 2020-03-08 13:45:52 -04:00
settings.gradle Initial Commit 2020-03-01 13:19:59 -05:00

SorceryCraft

Cast Spells in Minecraft!

This mod supports the Minecraft 1.16 snapshots.

What are Spells?

Spells are found throughout the world in chests. When you pick up a Spell you will learn it, one you learn a Spell you can apply it to a blank or existing Spell in the Casting Table. You can cast Spells by right-clicking. There is also a 30% chance the spell will rebound and hit you instead, unless the "Steadfast" Spell is applied.

What's a Casting Table?

You can apply Spells to blank or existing Spells in the Casting Table. Doing so will require a certain amount of levels, and sometimes may require an item.

Crafting

Blank Spell

Lapis Lazuli
Lapis Lazuli Paper Lapis Lazuli
Lapis Lazuli

Casting Table

Lapis Lazuli Cobblestone Lapis Lazuli
Cobblestone Diamond Cobblestone
Lapis Lazuli Cobblestone Lapis Lazuli

Spells

Spell Max Level Description
Flame 2 Sets target on fire.
Damage 2 Damages target.
Heal 2 Heals target.
Dissolve 1 Removes target's status effects.
Levitate 2 Gives target the Levitation effect.
Steadfast 1 Prevents Spell from rebounding.
Teleport 2 Teleports target to random location.
Inward 1 Causes the Spell to target the player. If the Spell fails instead of rebounding, it will just do nothing.
Cooling 1 Extinguish the target if they are on fire.

/spell Command

This command requires OP permissions.

/spell clear <player>

This command clears all known spells from the given player.

/spell list <player>

This lists all the spells the given player knows.

/spell learn <player> <spell-id> <level>

This teaches the specified spell to the specified player.

/spell add <player> <spell-id> <level>

This adds the specified spell to the item in the player's main hand.

/spell remove <player> <spell-id>

This removes the specified spell from the item in the player's main hand.

API

  1. Add Dependency to Gradle
    repositories {
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        modImplementation 'com.thebrokenrail:sorcerycraft:VERSION'
    }
    
  2. Add Dependency to fabric.mod.json
    {
        "depends": {
            "sorcerycraft": "1.1.x"
        }
    }
    
  3. Create a class extending com.thebrokenrail.sorcerycraft.spell.api.Spell
    public class ExampleSpell extends Spell {
       public ExampleSpell(Identifier id, int level) {
           super(id, level);
       }
    
       @Override
       public void execute(Entity target, Entity source, Entity attacker) {
           // Called when ExampleSpell hits an entity
       }
    
       @Override
       public void execute(World world, BlockHitResult hitResult) {
           // Called when ExampleSpell hits a block
       }
    
       @Override
       public int getXPCost() {
           // Return the amount of levels required to make ExampleSpell in a Casting Table
       }
    
       @Override
       public ItemStack getItemCost() {
           // Return the item(s) required to make ExampleSpell in a Casting Table
           // Return ItemStack.EMPTY if an item is not required
       }
    
       @Override
       public int getMaxLevel() {
           // Return ExampleSpell's maximum level
       }
    }
    
  4. Register the Spell in your ModInitializer
    public class ExampleMod implements ModInitializer {
        public static final Identifier EXAMPLE_SPELL = SpellRegistry.register(new Identifier("modid", "example_spell"), ExampleSpell.class);
    }
    
  5. Add Spell Translation
    {
        "spell.modid.example_spell": "Example"
    }
    

Useful Methods

  • Spell.getLevel()
  • Spell.getID()