feat: Enhance DataSpell - #1097
Open
DragonsAscent wants to merge 5 commits into
Open
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
A data-element key mismatch in DataLocation (location.light.block vs existing location.light.blocks) can break existing configurations when switching from entity to location targeting.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds location-target support to DataSpell so it can populate variables from either an entity target (preferred) or a targeted block location when no entity is found.
Changes:
- Introduced
DataLocationto exposeLocation -> Stringdata extractors (biome, block data/type, light, coords, world, etc.). - Updated
DataSpellto implementTargetedLocationSpelland to fall back from entity targeting to block-location targeting. - Refactored
DataSpellto resolve the configureddata-elementkey at cast-time and share variable-setting logic via a helper.
File summaries
| File | Description |
|---|---|
| core/src/main/java/com/nisovin/magicspells/util/data/DataLocation.java | New location data-element registry for DataSpell location targeting. |
| core/src/main/java/com/nisovin/magicspells/spells/targeted/DataSpell.java | Adds dual targeting (entity first, then block location) and applies either entity/location data to a variable. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
JasperLorelai
requested changes
Aug 24, 2026
Collaborator
|
Since this is an atomic PR (self-contained), you don't need to clear up history because we can merge with squash. |
…aSpell.java Co-authored-by: JasperLorelai <contact@jasperlorelai.eu>
…aSpell.java Co-authored-by: JasperLorelai <contact@jasperlorelai.eu>
…ion.java Co-authored-by: JasperLorelai <contact@jasperlorelai.eu>
…ion.java Co-authored-by: JasperLorelai <contact@jasperlorelai.eu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Support for targeting both entities and locations:
DataSpellnow implementsTargetedLocationSpelland can cast spells at both entities and locations.castto check for an entity target first, then fall back to a block location target if no entity is found.