[Bug] Players can cast spells while bleeding from PlayerRevive mod
CreativeMD opened this issue ยท 8 comments
Hey there,
I'm the author of PlayerRevive and someone reported an issue with your mod: CreativeMD/PlayerRevive#143
During bleedout state of the PlayerRevive mod, you are still able to cast spells, which should be blocked. In theory PlayerRevive blocks all interactions using the event InteractionKeyMappingTriggered
. Seems like IronSpells does ignore this event somehow?
Steps to reproduce
- Open singleplayer world
- Open to LAN
- Type in /kill
- Do spells
In Regards
CreativeMD
I cannot cancel all key and mouse input, this will break the game entirely. Furthermore these specific events cannot be cancelled. Not sure why you do things as you do, but I think it would be better if you rely on the vanilla interaction stuff. If not possible I don't see any solution to the problem besides a check if the player is downed. I could make this easily accessible for you to check, but not sure if you want to go down that route.
cancelling all key/mouse input, or including specific compat. more might be gleaned from our input handler https://github.com/iron431/irons-spells-n-spellbooks/blob/1.19.2/src/main/java/io/redspace/ironsspellbooks/player/ClientInputEvents.java
You can subscribe to the SpellCastEvent and cancel it to prevent casting while in that state
I don't think this is a good fix. I hoped we could figure out a more general solution which other mods could use as well.
what if you made the revival sequence a GUI with a revival button and a respawn button?
I could add a new method to the Player to check whether the player should be allowed to interact. This method could be accessed via reflection. @lab3 if you agree I can create a pull request for it, too.