Posted July 1, 201510 yr Hey, is there any event, or a way to tell me if minecraft is about to crash? I want, when minecraft is about to crash, to run some code.
July 1, 201510 yr https://en.wikipedia.org/wiki/Crash_%28computing%29 "...computer program stops functioning properly." That's the thing about crashes, you can't expect them to say: "hey, I just crashed". If you are basing anything on crashes then you are probably doing it wrong. If you want to make anti-crash system: there is no such thing, you would have to save everything per-tick or use direct-memory manipulation and data restoration (which I can't say if is possible in Java, maybe in deep java internals like unsafe). I'll just note that there are ways of making sure stuff is saved when program crashes, but that is ouside Forge (and I am not that good with Java to be smartass here). 1.7.10 is no longer supported by forge, you are on your own.
July 1, 201510 yr Author Well then how do crash reporting mods do it? They can upload the crash report to a remote server.
July 1, 201510 yr A wild guess - you want to auto-send crashes of your beta-testers to your repo somewhere? I suggest reading about JVM itself. MC is running 4 threads (maybe even more, like skin downloads, not sure, never looked). Crashing one thread (e.g running into infinite loop on Server thread) won't necessarily crash others. Program != Thread. Lookup on google on how to deal with it, there is plenty of it, it's just not shipped as forge event, because that is not forge's job. Thread.class itself has exception handlers of some sorts. You could e.g run background thread that will be catching errors from other threads for you and doing stuff with them. Disclaimer: 1.7.10 is no longer supported by forge, you are on your own.
July 1, 201510 yr Author Right on the money. I figured I'd look deeper into this, just thought I'd see if there was anything built into forge to help me out.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.