淺看Minecraft崩潰日志,來學(xué)學(xué)如何解決崩潰
我最近在玩一些Minecraft的模組,有的時候因遇到崩潰而火冒三丈。后來慢慢研究才發(fā)現(xiàn)解決崩潰還是非常容易的,在這里我會擺一些小技巧給大家參考一下~
(ps:我還不是內(nèi)行

1.日志
游戲崩潰的時候一般會將崩潰的分析結(jié)果放在崩潰日志中,這時候就需要我們?nèi)ピ俣确治觥?/p>
在用HMCL啟動器的小伙伴,如果你們的游戲崩潰,默認(rèn)情況下會自動彈出崩潰日志,而且一般已經(jīng)用幾種顏色標(biāo)記以方便玩家分析,一般情況下有三種:
白色(info——信息)
用于提醒玩家運行了什么必要的數(shù)據(jù)。
黃色(warns——警告)
在處理一些數(shù)據(jù)的時候發(fā)現(xiàn)了一些小問題,極少可能會阻礙游戲運行。
紅色(errors——錯誤)
在處理一些數(shù)據(jù)的時候發(fā)現(xiàn)了一些大問題,可能會阻礙游戲運行。
那是不是我們只關(guān)注紅色(errors)就好呢,并不是的,在后面我會講到。
如果你們不小心關(guān)掉了崩潰日志,或者不是HMCL啟動器的用戶,你也可到
.minecraft\crash-reports下找到最近日期的崩潰文件。這種崩潰文件一般是以
crash-年-月-日_時.分.秒-類型的命名呈現(xiàn)的。
其中類型包括client(客戶端)和server(服務(wù)端),客戶端是直接用啟動器(如HMCL)啟動的游戲,服務(wù)端是用開服文件啟動的服務(wù)器。
當(dāng)然還可以在log中找到,比較繁瑣。
但是這種崩潰日志并不會有相應(yīng)的顏色顯示,但也不要為此傷心,還是可以直接看出來的。

2.分析
2.1 初步分析
找到了崩潰日志,現(xiàn)在就來打開看看吧~
---- Minecraft Crash Report ----
Time: 2/24/20 10:44 AM
Description: There was a severe problem during mod loading that has caused the game to failnet.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Tough As Nails (toughasnails)
Caused by: java.lang.NullPointerException
?at toughasnails.init.ModConfig.lambda$init$0(ModConfig.java:64)
...45 more
A detailed walkthrough of the error, its code path and all known details is as follows:
----------------------------------------------------------------------------------------- System Details --
Details:
?Minecraft Version: 1.12.2
?Operating System: Windows 10 (amd64) version 10.0
?Java Version: 1.8.0_201, Oracle Corporation
?Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
?Memory: 159206784 bytes (151 MB) / 520093696 bytes (496 MB) up to 1879048192 bytes (1792 MB)
?JVM Flags: 11 total; -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M -XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Xmn128m -Xmx1792m -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
?IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0?FML: MCP 9.42 Powered by Forge 14.23.5.2838 7 mods loaded, 7 mods active
?States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored| State | ID?????????? | Version????? | Source????????????????????????????????????? | Signature??????????????????????????????? |
?|:----- |:------------ |:------------ |:------------------------------------------- |:---------------------------------------- |
?| LCHI? | minecraft??? | 1.12.2?????? | minecraft.jar?????????????????????????????? | None???????????????????????????????????? |
?| LCHI? | mcp????????? | 9.42???????? | minecraft.jar?????????????????????????????? | None???????????????????????????????????? |
?| LCHI? | FML????????? | 8.0.99.99??? | forge-1.12.2-14.23.5.2838.jar?????????????? | e3c3d50c7c986df74c645c0ac54639741c90a557 |
?| LCHI? | forge??????? | 14.23.5.2838 | forge-1.12.2-14.23.5.2838.jar?????????????? | e3c3d50c7c986df74c645c0ac54639741c90a557 |
?| LCHI? | itemrender?? | @VERSION@??? | IRR_V1.1.0_MC1.12.2.jar???????????????????? | None???????????????????????????????????? |
?| LCHE? | toughasnails | 3.1.0.139??? | ToughAsNails-1.12.2-3.1.0.139-universal.jar | None???????????????????????????????????? |
?| LCH?? | tanspit????? | 1.12-1.0???? | tanspit-1.12-1.0.jar??????????????????????? | None???????????????????????????????????? |?Loaded coremods (and transformers):
?GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.6.13559 Compatibility Profile Context 26.20.12001.11014' Renderer: 'AMD Radeon(TM) Vega 8 Graphics'? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 為節(jié)約空間修改了部分字段
對于初學(xué)者,第一件事可以先看整個崩潰日志的最下方,有一個自帶形狀的表格(雖然很挫),寫上了被識別了的所有模組(粗略來說)。

在這里我們注意的是左側(cè)帶有LCHI或者LCHE這一列,每一個字母都帶有他自己的意思,表格上方已經(jīng)說明了,這里我給大家舉例一些比較重要的:
L 表明這個模組已經(jīng)加載。
H 表明這個模組已經(jīng)預(yù)初始化。
I 表明這個模組已經(jīng)初始化完成,已經(jīng)載入進(jìn)去了游戲,表示這個模組可以正常運作。
D 表明這個模組是失效的模組。
E 表明這個模組在加載時發(fā)生了錯誤。
U 表明這個模組加載時被中止。
在本崩潰文件中,我們可以發(fā)現(xiàn)在加載到thoughsnails(意志堅定)這個模組的時候發(fā)生了錯誤,這個時候我們可以選擇刪掉模組去官網(wǎng)換一個最新版本的模組,或者干脆就不用吧。
2.2 深層分析
?---- Minecraft Crash Report ----
Time: 4/24/20 4:02 PM
Description: There was a severe problem during mod loading that has caused the game to failnet.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from YukariLib (yukarilib)
Caused by: c6h2cl2.YukariLib.PlayerNotOfficialPurchasedException: You must buy Minecraft from Official Site!!!
?at c6h2cl2.YukariLib.YukariLibCore.check(YukariLibCore.kt:89)
...41 moreA detailed walkthrough of the error, its code path and all known details is as follows:
----------------------------------------------------------------------------------------- System Details --
Details:
?Minecraft Version: 1.12.2
?Operating System: Windows 10 (amd64) version 10.0
?Java Version: 1.8.0_111, Oracle Corporation
?Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
?Memory: 162140216 bytes (154 MB) / 436207616 bytes (416 MB) up to 2147483648 bytes (2048 MB)
?JVM Flags: 11 total; -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M -XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Xmn128m -Xmx2048m -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
?IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
?FML: MCP 9.42 Powered by Forge 14.23.5.2847 18 mods loaded, 18 mods active
?States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored?| State | ID????????????????? | Version?????????? | Source??????????????????????????????????????????? | Signature |
?|:----- |:------------------- |:----------------- |:------------------------------------------------- |:--------- |
?| LCH?? | minecraft?????????? | 1.12.2??????????? | minecraft.jar???????????????????????????????????? | None????? |
?| LCH?? | mcp???????????????? | 9.42????????????? | minecraft.jar???????????????????????????????????? | None????? |
?| LCH?? | FML???????????????? | 8.0.99.99???????? | forge-1.12.2-14.23.5.2847.jar???????????????????? | None????? |
?| LCH?? | forge?????????????? | 14.23.5.2847????? | forge-1.12.2-14.23.5.2847.jar???????????????????? | None????? |
?| LCH?? | cxlibrary?????????? | 1.6.1???????????? | cxlibrary-1.12.1-1.6.1.jar??????????????????????? | None????? |
?| LCH?? | multipagechest????? | 1.9.1???????????? | MultiPageChest-1.12-1.9.1.jar???????????????????? | None????? |
?| LCE?? | yukarilib?????????? | 1.3.0???????????? | YukariLib-1.12-1.3.0.jar????????????????????????? | None????? |
?| LC??? | reinforcedtools???? | 2.1.1???????????? | ReinforcedTools-2.1.1.jar???????????????????????? | None????? |
?| LC??? | tconstruct????????? | 1.12.2-2.12.0.135 | TConstruct-1.12.2-2.12.0.135.jar????????????????? | None????? |
?| LC??? | torcherino????????? | 7.5?????????????? | torcherino-7.5.jar??????????????????????????????? | None????? |
?| LC??? | worldedit?????????? | 6.1.8???????????? | 創(chuàng)世神.jar?????????????????????????????????????????? | None????? |?Loaded coremods (and transformers):
CXLibraryCore (cxlibrary-1.12.1-1.6.1.jar)
? cubex2.cxlibrary.CoreModTransformer
?GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 391.35' Renderer: 'GeForce GT 440/PCIe/SSE2'? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? 為節(jié)約空間修改了部分字段
好的,這是另一位受害者的崩潰日志,來小練一下~
I————————————————————————————————————————I
沒錯,是yukarilib的禍,刪掉刪掉。
但有比較細(xì)心的小伙伴可能看出來了,為什么頂部也有一個地方顯示了yukarilib呢,那如果我從上面看是不是會得到更詳細(xì)的答案呢?
*啪* 明知故問,我提出來的問題難不成還有別的答案awa

沒錯,如果我們從上面的Description(描述)和Caused by(導(dǎo)致原因)后面的句子可以大致判斷出誰是幕后黑手,還很有可能知道它的動機!
yukarilib的動機... ...的確有點心狠手辣啊...

在HMCL提供的日志中,只有Description會標(biāo)紅。(maybe)
更多的例子,這里便不再展示,也許將來我會發(fā)更多的實例給大家分享。
如果你看到了這里,你已經(jīng)大致上了解了模組崩潰。
如果你仍然看不懂,你還可以到評論區(qū)下方留言。
記得...點贊哦~