Minecraft-CameraOverhaul icon indicating copy to clipboard operation
Minecraft-CameraOverhaul copied to clipboard

Unable to create infinite shaking

Open slava110 opened this issue 10 months ago • 2 comments

Hi. I want to create infinite shaking at specific position. However, when I set lengthInSeconds to 0 or -1, shake doesn't happen. When I set lengthInSeconds to any other value - it works but only for specified amount of time. I'm using Camera Overhaul 2.0.0-forge+mc.1.19.3-1.20.5 as dependency on 1.20.1.

slava110 avatar Mar 05 '25 21:03 slava110

Floats have a PositiveInfinity value that should work here, but I don't know how you would remove the screenshake instance in that case. I didn't write the related code as an API, and you should be careful using functions not in an API package, which I guess now has a reason to be made. Try-catch everything for the time being.

Mirsario avatar Mar 07 '25 11:03 Mirsario

Hi again. Thanks for answering! Currently I'm using positive infinity, yeah, but not sure if it will tick out eventually Or it's... The point of infinity lol. That it won't tick out. To remove it I simply get existing instance and set time to lower value currently. I don't need instant removal, I need a phase before that in my concept (or fade out), so it works for me. As about API... I don't think Minecraft mods really need an API unless you want to provide stable interface. But usually APIs lacks in functionality. Up to you if you want to provide it c: Maybe it'll be fine in case of a small mod to provide an API

slava110 avatar Mar 07 '25 22:03 slava110