Tome Spell - TheComputerGeek2/MagicSpells GitHub Wiki

Source Code

spell-class: ".command.TeachSpell"
  • delayed - Plays the effect on the player who used the tome.

Description:

This spell creates a tome book that can be read right-clicked to learn a spell. The caster must hold a written book for it to become a tome. You can pass a spell to bind using the cast command or subspell args. You can also optionally pass a number of uses that define how many times the tome can be used to teach this spell. If none are defined, default-uses is the amount used. Uses may be negative to define an infinite amount.

Configuration:

Since 4.0 Beta 13 some of these options support dynamic values through numeric or string expressions.

Option Description Type Default Supports expressions
consume-book Defines whether the tome book should be removed from the player's inventory once depleted. Boolean false false
allow-overwrite Defines whether a held tome can be overwritten to be a different one. Boolean false true
require-teach-perm Defines whether the player must have the teach permissions for that spell to bind it to the tome. Boolean true true
cancel-read-on-learn Defines whether the book reading should be cancelled when the spell is learned. Boolean true false
max-uses This helps clip pass uses down to a maximum value. Integer 5 true
default-uses Defines the number of uses this tome has to teach players its spell. This amount may be negative to define an infinite amount of uses. Integer -1 true
str-usage Sent if no spell cast arguments are passed. Rich Text "Usage: While holding a written book, /cast tome <spell> [uses]" true
str-no-book Rich Text "You must be holding a written book." true
str-no-spell Rich Text "You do not know a spell with that name." true
str-learned Rich Text "You have learned the %s spell." true
str-cant-learn Rich Text "You cannot learn the spell in this tome." true
str-cant-teach Rich Text "You cannot create a tome with that spell." true
str-already-known Rich Text "You already know the %s spell." true
str-already-has-spell Rich Text "That book already contains a spell." true

Additional Placeholders:

  • str-cast-self/target:
    • %s: Spell name.
⚠️ **GitHub.com Fallback** ⚠️