Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Links
Creators
Details
Shoulder Surfing: Iron's Spells Integration
A simple client-side mod that integrates Shoulder Surfing Reloaded and Iron's Spells 'n Spellbooks, making the camera automatically follow your crosshair whenever you cast a spell—via spellbooks, normal spells, or quick cast. Compatible with controller mods.
Compatibility
Tested with the following mods and works as expected:
Bug reports
This isn't an official Shoulder Surfing Reloaded addon, so any issues should be reported to this mod issue tracker rather than to the Shoulder Surfing Reloaded team.
Technical Implementation
This mod fixes issues you may encounter when using the Shoulder Surfing Perspective.
The fixes are universal and apply regardless of whether the camera is decoupled or not.
Here are the issues that this mod fix:
Continuous Spell Casting
This mod uses the IAdaptiveItemCallback
callback provided by the Shoulder Surfing Reloaded mod so that it identifies as if we're aiming at the crosshair target,
ensuring the player looks at the crosshair target regardless of the spell cast source (e.g., spell book, scroll item)
and whether the camera is decoupled or not.
This fix is effective even when the camera is coupled, because without it, casting a continuous spell in Shoulder Surfing causes the player to look straight ahead instead of at the crosshair.
Look at Crosshair Target When Casting via Spell Book
When casting a spell using a scroll item by right-clicking with the mouse, the Shoulder Surfing mod will automatically look at the crosshair target if the camera is decoupled. This is not the case when casting spells via spell books, which is a common method.
Mixins into the constructors of
CastPacket
and
QuickCastPacket
,
since these are only constructed from the client side and only when the player is casting a spell from a keybind. This
ensures that the mod stays compatible with any controller mod and remains client-side without sending packets to the
network.
The official API provided by the Iron Spells mod is currently a bit limited, and all events are called on the server side only. This makes it difficult to keep this mod client-side only while still supporting controller mods and avoiding dependency on their internal APIs.
Always Look at Crosshair Target When Using a Scroll Item
We call ShoulderSurfingImpl.lookAtCrosshairTarget
before
Scroll.use
is called to fix two issues:
- The Shoulder Surfing mod automatically calls
ShoulderSurfingImpl.lookAtCrosshairTarget
when you use any item if the camera is decoupled. However, when using a scroll item via controller, Shoulder Surfing does not recognize it. - This fix is useful even if you don't use a controller, because when the camera is coupled,
ShoulderSurfingImpl.lookAtCrosshairTarget
is not called automatically. Without this fix, spells will be cast straight ahead of the player instead of aiming at the crosshair target.
The player will always look at the crosshair target, regardless of whether the camera is coupled or decoupled, and regardless of the input method—controller or keyboard.
Disclaimer
This mod is NOT AN OFFICIAL MINECRAFT PRODUCT.
It is NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.This mod is not affiliated with the Shoulder Surfing Reloaded Team or Iron's Spells 'n Spellbooks.
License
You can also find the source code on GitHub.