Download Project MMO: Iron's Spellbooks Compat — Minecraft Mods — MetaMods

Project MMO: Iron's Spellbooks Compat

Active

Downloads

1

Last update

8 months ago
Client
Magic
Addons

Project MMO: Iron's Spellbooks Compat

About the Modification

This compatibility mod allows setting skill-level requirements for spells using datapacks. If a player's skill level is insufficient, they won't be able to cast the corresponding spell. You can also configure requirements separately for each spell level. These settings can be applied only when using scrolls, spellbooks, and/or swords. Additionally, you can block the inscription of spells into spellbooks entirely until requirements are met.

The configuration also includes an option to award experience to a player whose spell heals another participant. This feature enables players who choose the healer or priest role to level up skills while aiding allies.

Configuration Guide

The easiest way to get started is to enter the desired world and execute the command:

/pmmo_irons_compat genSpellData

This command creates a datapack with default settings for all spells available in Iron's Spells and Spellbooks. You can modify this datapack and then delete JSON files for spells you don't need to configure. The command can be run at any time to update the spell list without affecting existing JSON files.

After executing the command and creating the datapack, I modified the fireball.json file as follows:

{
  "requirements": {
    "1": {},
    "2": { "magic":  5}
  },
  "default_requirements": {
    "magic": 10,
    "charisma": 2
  },
  "sources": [
    "scroll",
    "spellbook",
    "sword",
    "inscribe"
  ],
  "replace": true
}

The "default_requirements" parameter adds requirements for all levels of the "fireball" spell. In this case, casting fireball at any level requires magic level 10 and charisma level 2.

The "requirements" section allows setting requirements for specific spell levels. In this example, level 1 fireball has no casting requirements, overriding "default_requirements" for this level. Level 2 fireball requires magic level 5. All other spell levels require magic level 10 and charisma level 2.

The "sources" section specifies when to apply these restrictions. With the current settings, fireball cannot be cast from scrolls, spellbooks, or swords. Also, the spell cannot be inscribed into a spellbook until requirements are met. To allow spell casting from scrolls, for example, simply remove "scroll" from the "sources" list.

The "replace" parameter resolves datapack conflicts. If multiple datapacks contain requirements for the same spell, the datapack with "replace":true will overwrite parameters in datapacks set to false. If there are multiple datapacks with "replace":true, the last loaded datapack will be used.

All parameters are optional. To add a requirement only to a specific spell level, you can omit "default_requirements". To set general requirements for all levels, use only "default_requirements", deleting "requirements". If "sources" is not specified, requirements won't take effect at all — in this case, the file can be safely deleted.

Credits

Huge thanks to Caltinor and the Project MMO team for constant assistance and access to the project's source code. Also, thanks to the Iron's Spells and Spellbooks developers for the opportunity to merge several PRs to call events, which avoided the need to use mixins for this compatibility to work.

Project members
Silvertide

Silvertide

Created: 31 Jan 2025

ID: 88492