[英]How do i fix an error during common_setup in my 1.19.2 minecraft mod"
the crash report for minecraft that happens when i use the mod.我使用 mod 时发生的我的世界崩溃报告。
---- Minecraft Crash Report ----
// I bet Cylons wouldn't have this problem.
Time: 2022-09-18 13:58:06
Description: Mod loading error has occurred
java.lang.Exception: Mod Loading has failed
at net.minecraftforge.logging.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:55) ~[forge-1.19.2-43.1.1-universal.jar%23151!/:?] {re:classloading}
at net.minecraftforge.client.loading.ClientModLoader.completeModLoading(ClientModLoader.java:167) ~[forge-1.19.2-43.1.1-universal.jar%23151!/:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:585) ~[client-1.19.2-20220805.130853-srg.jar%23146!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.Util.m_137521_(Util.java:438) ~[client-1.19.2-20220805.130853-srg.jar%23146!/:?] {re:classloading}
at net.minecraft.client.Minecraft.lambda$new$3(Minecraft.java:579) ~[client-1.19.2-20220805.130853-srg.jar%23146!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.gui.screens.LoadingOverlay.m_6305_(LoadingOverlay.java:135) ~[client-1.19.2-20220805.130853-srg.jar%23146!/:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.renderer.GameRenderer.m_109093_(GameRenderer.java:885) ~[client-1.19.2-20220805.130853-srg.jar%23146!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1115) ~[client-1.19.2-20220805.130853-srg.jar%23146!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:700) ~[client-1.19.2-20220805.130853-srg.jar%23146!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.main.Main.m_239872_(Main.java:212) ~[client-1.19.2-20220805.130853-srg.jar%23146!/:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.main.Main.main(Main.java:51) ~[client-1.19.2-20220805.130853-srg.jar%23146!/:?] {re:classloading,pl:runtimedistcleaner:A}
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:27) ~[fmlloader-1.19.2-43.1.1.jar%2395!/:?] {}
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-10.0.8.jar%2382!/:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-10.0.8.jar%2382!/:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-10.0.8.jar%2382!/:?] {}
at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-10.0.8.jar%2382!/:?] {}
at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-10.0.8.jar%2382!/:?] {}
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-10.0.8.jar%2382!/:?] {}
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-10.0.8.jar%2382!/:?] {}
at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) [bootstraplauncher-1.1.2.jar:?] {}
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Render thread
Stacktrace:
at net.zenith.tutorialmod.tutorialmod.commonSetup(tutorialmod.java:43) ~[zenith_zoonies0.01.jar%23145!/:?] {re:classloading}
-- MOD tutorialmod --
Details:
Mod File: /C:/Users/antho/AppData/Roaming/.minecraft/mods/zenith_zoonies0.01.jar
Failure message: Zeniths Zoonies (tutorialmod) encountered an error during the common_setup event phase
java.lang.NoSuchFieldError: DIRT
Mod Version: 0.0.1-1.19.2
Mod Issue URL: NOT PROVIDED
Exception message: java.lang.NoSuchFieldError: DIRT
Stacktrace:
at net.zenith.tutorialmod.tutorialmod.commonSetup(tutorialmod.java:43) ~[zenith_zoonies0.01.jar%23145!/:?] {re:classloading}
at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.3.jar%2379!/:?] {}
at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252) ~[eventbus-6.0.3.jar%2379!/:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.3.jar%2379!/:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.3.jar%2379!/:?] {}
at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:107) ~[javafmllanguage-1.19.2-43.1.1.jar%23148!/:?] {}
at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:122) ~[fmlcore-1.19.2-43.1.1.jar%23147!/:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {}
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {}
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {}
-- System Details --
Details:
Minecraft Version: 1.19.2
Minecraft Version ID: 1.19.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 17.0.3, Microsoft
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
Memory: 480729000 bytes (458 MiB) / 771751936 bytes (736 MiB) up to 2147483648 bytes (2048 MiB)
CPUs: 20
Processor Vendor: GenuineIntel
Processor Name: Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
Identifier: Intel64 Family 6 Model 165 Stepping 5
Microarchitecture: unknown
Frequency (GHz): 3.70
Number of physical packages: 1
Number of physical CPUs: 10
Number of logical CPUs: 20
Graphics card #0 name: NVIDIA GeForce RTX 2070 SUPER
Graphics card #0 vendor: NVIDIA (0x10de)
Graphics card #0 VRAM (MB): 4095.00
Graphics card #0 deviceId: 0x1e84
Graphics card #0 versionInfo: DriverVersion=30.0.15.1215
Memory slot #0 capacity (MB): 8192.00
Memory slot #0 clockSpeed (GHz): 2.13
Memory slot #0 type: DDR4
Memory slot #1 capacity (MB): 8192.00
Memory slot #1 clockSpeed (GHz): 2.13
Memory slot #1 type: DDR4
Virtual memory max (MB): 24917.83
Virtual memory used (MB): 16789.46
Swap memory total (MB): 8611.82
Swap memory used (MB): 206.44
JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
ModLauncher: 10.0.8+10.0.8+main.0ef7e830
ModLauncher launch target: forgeclient
ModLauncher naming: srg
ModLauncher services:
mixin-0.8.5.jar mixin PLUGINSERVICE
eventbus-6.0.3.jar eventbus PLUGINSERVICE
fmlloader-1.19.2-43.1.1.jar slf4jfixer PLUGINSERVICE
fmlloader-1.19.2-43.1.1.jar object_holder_definalize PLUGINSERVICE
fmlloader-1.19.2-43.1.1.jar runtime_enum_extender PLUGINSERVICE
fmlloader-1.19.2-43.1.1.jar capability_token_subclass PLUGINSERVICE
accesstransformers-8.0.4.jar accesstransformer PLUGINSERVICE
fmlloader-1.19.2-43.1.1.jar runtimedistcleaner PLUGINSERVICE
modlauncher-10.0.8.jar mixin TRANSFORMATIONSERVICE
modlauncher-10.0.8.jar fml TRANSFORMATIONSERVICE
FML Language Providers:
minecraft@1.0
lowcodefml@null
javafml@null
Mod List:
client-1.19.2-20220805.130853-srg.jar |Minecraft |minecraft |1.19.2 |SIDED_SETU|Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
forge-1.19.2-43.1.1-universal.jar |Forge |forge |43.1.1 |SIDED_SETU|Manifest: 84:ce:76:e8:45:35:e4:0e:63:86:df:47:59:80:0f:67:6c:c1:5f:6e:5f:4d:b3:54:47:1a:9f:7f:ed:5e:f2:90
zenith_zoonies0.01.jar |Zeniths Zoonies |tutorialmod |0.0.1-1.19.2 |ERROR |Manifest: NOSIGNATURE
Crash Report UUID: 85069c39-8331-4f0b-b76d-3e7f1eea1ba9
FML: 43.1
Forge: net.minecraftforge:43.1.1
Some of the code from the mod,i wasnt sure which code to include but im guessing this should be included mod中的一些代码,我不确定要包含哪些代码,但我猜应该包含
package net.zenith.tutorialmod;
import com.mojang.logging.LogUtils;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.ForgeRegistries;
import net.zenith.tutorialmod.block.ModBlocks;
import net.zenith.tutorialmod.item.ModItems;
import org.slf4j.Logger;
// The value here should match an entry in the META-INF/mods.toml
file
@Mod(tutorialmod.MOD_ID)
public class tutorialmod {
public static final String MOD_ID = "tutorialmod";
private static final Logger LOGGER = LogUtils.getLogger();
public tutorialmod()
{
IEventBus modEventBus =
FMLJavaModLoadingContext.get().getModEventBus();
ModItems.register(modEventBus);
ModBlocks.register(modEventBus);
modEventBus.addListener(this::commonSetup);
// Register ourselves for server and other game events we are
interested in
MinecraftForge.EVENT_BUS.register(this);
}
private void commonSetup(final FMLCommonSetupEvent event)
{
// Some common setup code
LOGGER.info("HELLO FROM COMMON SETUP");
LOGGER.info("DIRT BLOCK >> {}",
ForgeRegistries.BLOCKS.getKey(Blocks.DIRT));
}
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
@Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public static class ClientModEvents {
@SubscribeEvent
public static void onClientSetup(FMLClientSetupEvent event) {
}
}
}
The important part of the error is java.lang.NoSuchFieldError: DIRT
.错误的重要部分是java.lang.NoSuchFieldError: DIRT
。 I suspect you compiled your mod with ./gradlew jar
and then tried to run it in ordinary Minecraft.我怀疑您使用./gradlew jar
编译了您的 mod,然后尝试在普通的 Minecraft 中运行它。 The problem is that the output of ./gradlew jar
only works in development environments, and causes errors like yours otherwise.问题是 ./gradlew jar 的./gradlew jar
仅适用于开发环境,否则会导致类似您的错误。 To get one that works outside of development environments, compile with ./gradlew build
instead.要获得在开发环境之外工作的版本,请改用./gradlew build
进行编译。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.