Call your function in game by typing the command
We get an error saying the function is not defined! We have defined the function in our plugin, but it has not been exported to the global namespace
If we want to write a function that can be called in game using the
/js command, we need to export it first using the syntax
exports.functionName = functionName;
Add a parameter to the
setSpell() function called
spellName that we will use to determine which wand to place in the player's hand when they call the function.
We then check to see if the
spellName provided was
"Vanishing". If it is, we set the item in the player's hand to a
magicWand_Vanishing and send them the message: "Spell set to Vanishing"