Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a spell casting system to let a player cast spells without needing to type in a command.
How it works:
Cast a spell:
When a player is holding a stick with the custom name "Magic Wand" in the main hand while sneaking, the system records a point where the player is looking at. Now the player moves his head to draw a pattern in front of him. Once the player stopps sneaking, the system analyses the pattern and tries to map it to a known pattern which will cast a spell. A pattern consists of an infinte sequence of lines with each line being one of 8 types: up, down, left, right, up-left, up-right, down-left or down-right.Bind a spell to a custom pattern:
To bind a spell to a custom pattern, the player needs to typ in the command/spell bind <SpellName>
. Now the player just needs to draw the pattern he wants to bind the spell to and after that, the custom pattern will trigger the spell. It is possible to bind the same spell to multiple patterns, however binding a spell to a pattern bound to another spell will override which spell is bound to the pattern.