Skip to content

feat: ProxySpell - #1100

Open
DragonsAscent wants to merge 14 commits into
TheComputerGeek2:mainfrom
DragonsAscent:proxy-spell
Open

feat: ProxySpell#1100
DragonsAscent wants to merge 14 commits into
TheComputerGeek2:mainfrom
DragonsAscent:proxy-spell

Conversation

@DragonsAscent

Copy link
Copy Markdown
Collaborator

Allows the caster to designate an entity as a "proxy". Any spell / damage will be redirected to the caster treating that entity as if it were the caster themself.

Copilot AI lite review requested due to automatic review settings August 23, 2026 19:09

This comment was marked as resolved.

Comment thread core/src/main/java/com/nisovin/magicspells/spells/buff/ProxySpell.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/spells/buff/ProxySpell.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/spells/buff/ProxySpell.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/spells/buff/ProxySpell.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/spells/buff/ProxySpell.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/spells/buff/ProxySpell.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/spells/buff/ProxySpell.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/spells/buff/ProxySpell.java Outdated
Comment thread core/src/main/java/com/nisovin/magicspells/spells/buff/ProxySpell.java Outdated
@JasperLorelai

Copy link
Copy Markdown
Collaborator

I actually ended up removing the SpellPreImpactEvent handler. SpellTargetEvent is always called before it and already handles the proxy swapping.

}

@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void onEntityDamage(EntityDamageByEntityEvent event) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the proxy receive damage from events not dealt by another entity?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel like it should be a config option

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, idk. The only purpose the damager has in this handler atm is that it's used for the spell effects. So imo, if a proxy receives any damage, it should be relayed, even if it wasn't caused by a third entity.


event.setCancelled(true);
try {
proxyTarget.damage(event.getDamage(), event.getDamageSource());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not actually sure if the causing/direct entity should be swapped here as well.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your PR description says:

Allows the caster to designate an entity as a "proxy". Any spell / damage will be redirected to the caster treating that entity as if it were the caster themself.

If the ending bit is a typo, meant to be "target", then this can be left alone.

Otherwise, if you implied that the proxy should become the caster of these spells, the original caster forgotten, then the causing entity should be swapped, but the SpellTargetEvent is missing the caster swap too. Imo, the original caster/damager should remain.

Comment thread core/src/main/java/com/nisovin/magicspells/spells/buff/ProxySpell.java Outdated
…ell.java

Co-authored-by: JasperLorelai <contact@jasperlorelai.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants