Skip to content
JasperLorelai edited this page May 19, 2024 · 2 revisions

Source Code

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

Description:

This spell creates a SpellBook block at the block the caster is looking at which teaches players which right-click a specific spell. You can pass a spell to be bound to the block using the cast command or subspell args. You can also optionally pass the number of uses this SpellBook provides. If none are passed, default-uses are used for that amount. Uses may be a negative number to specify infinite uses.

A created SpellBook block can only be destroyed by opped players or players with the magicspells.advanced.spellbook permission.

Configuration:

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

Option Description Type Default Supports expressions
spellbook-block Block type required for this spell to bind it to. String "bookshelf" false
default-uses If no uses are passed with spell cast arguments, this is the amount used. Integer -1 false
destroy-when-used-up Defines whether to destroy the SpellBook block (set to an air block) when uses are depleted. Boolean false false
str-usage Sent if no spell cast arguments are passed. Rich Text "Usage: /cast spellbook <spell> [uses]" true
str-no-spell Rich Text "You do not know a spell by that name." true
str-learned Rich Text "You have learned the %s spell!" true
str-no-target Rich Text "You must target a bookcase to create a spellbook." true
str-cant-teach Rich Text "You can't create a spellbook with that spell." true
str-cant-learn Rich Text "You cannot learn the spell in this spellbook." true
str-learn-error Rich Text true
str-cant-destroy Rich Text "You cannot destroy a bookcase with a spellbook." true
str-has-spellbook Rich Text "That bookcase already has a spellbook." true
str-already-known Rich Text "You already know the %s spell." true

Additional Placeholders:

  • str-cast-self, str-cant-learn, str-already-known, and str-learned:
    • %s: Spell name.
Clone this wiki locally