Iron's Spells 'n Spellbooks

Iron's Spells 'n Spellbooks

24M Downloads

[API] Provide client-side events for other mods when casting a spell

EchoEllet opened this issue · 0 comments

commented

Description

I maintain a client-side mod called Shoulder Surfing: Iron Spells Integration, which currently works as expected.
It enables all features of this mod to function with Shoulder Surfing and also supports controller mods.

To achieve this, I need a client-side event that triggers before casting a spell — whether through the spellbook (quick cast or keybind) or a scroll item.
Currently, the available public API events are server-side only, requiring me to send a network packet to the client and handle it there. This is inefficient, introduces delay, and requires the mod to be installed on the server.

As a workaround, I used a mixin on internal classes of this mod, which is unreliable and prone to breaking changes after updates.

Note

We need an API design compatible with most mods, not just this use case. I plan to look into it and submit a PR when possible, but I’d like to keep this issue open for tracking.

Not a feature request

  • I understand this is not a content/feature request, which can be found on discord