当前位置: 首页 > 知识库问答 >
问题:

Minecraft moding:Mod仅在IDE中工作,但在导出为jar时无效

舒浩邈
2023-03-14

目前,我将尝试编写一个简单的Minecraft mod,它会自动将文本写入Minecraft书籍
当我在IDE(Eclipse)的帮助下从项目文件夹启动Minecraft时,这个Mod可以正常工作<但是当我用Mod启动Minecraft时,通常没有IDE Minecraft崩溃
我用布料代替锻造。

当我尝试加入单人世界时,我会收到以下崩溃消息:

MultiMC version: 0.6.7-1375


Minecraft folder is:
G:/Games/MultiMC/instances/1.15.1 fabric - own mod/.minecraft


Java path is:
C:/Program Files (x86)/Common Files/Oracle/Java/javapath/javaw.exe


Java is version 1.8.0_202, using 64-bit architecture.


Main Class:
  net.fabricmc.loader.launch.knot.KnotClient

Native path:
  G:/Games/MultiMC/instances/1.15.1 fabric - own mod/natives

Traits:
traits FirstThreadOnMacOS

Mods:
  [✔️] BookFiller-1.0.0-dev
  [✔️] fabric-api-0.4.26+build.283-1.15

Params:
  --username  --version MultiMC5 --gameDir G:/Games/MultiMC/instances/1.15.1 fabric - own mod/.minecraft --assetsDir G:/Games/MultiMC/assets --assetIndex 1.15 --uuid  --accessToken  --userType  --versionType release

Window size: 854 x 480

Java Arguments:
[-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump, -Xms1536m, -Xmx8064m, -Duser.language=en]


Minecraft process ID: 12320


Using onesix launcher.

[20:59:25] [main/INFO]: Loading for game Minecraft 1.15.1
[20:59:28] [main/INFO]: [FabricLoader] Loading 34 mods: minecraft@1.15.1, fabric-renderer-api-v1@0.2.7+f3d8141b95, fabric-networking-blockentity-v0@0.2.3+e08a730595, fabric-keybindings-v0@0.1.1+dfdb52d695, fabricloader@0.7.3+build.176, fabric-renderer-indigo@0.2.21+175d0eb895, fabric-containers-v0@0.1.3+b7f9825d95, fabric-dimensions-v1@0.2.3+06c939b395, fabric-biomes-v1@0.1.5+3b05f68e95, fabric-crash-report-info-v1@0.1.2+b7f9825d95, fabric-events-interaction-v0@0.2.6+12515ed995, fabric-api-base@0.1.2+b7f9825d95, fabric-rendering-v0@1.1.0+5341049095, fabric-rendering-v1@0.1.0+5341049095, fabric-rendering-data-attachment-v1@0.1.3+b7f9825d95, fabric-resource-loader-v0@0.1.10+06c939b395, fabric-textures-v0@1.0.4+821cdba795, fabric-content-registries-v0@0.1.3+b7f9825d95, fabric-tag-extensions-v0@0.1.3+abd9158095, fabric-rendering-fluids-v1@0.1.6+12515ed995, fabric-registry-sync-v0@0.2.6+f3d8141b95, fabric-commands-v0@0.1.2+b7f9825d95, fabric-blockrenderlayer-v1@1.1.4+c6a8ea8995, fabric-mining-levels-v0@0.1.1+b7f9825d95, fabric-renderer-registries-v1@2.0.1+5a0f9a6095, fabric-loot-tables-v1@0.1.5+e08a730595, fabric-events-lifecycle-v0@0.1.2+b7f9825d95, bookfiller@1.0.0, fabric@0.4.26+build.283-1.15, fabric-particles-v1@0.1.1+dfdb52d695, fabric-models-v0@0.1.0+dfdb52d695, fabric-item-groups-v0@0.1.6+ec40b2e195, fabric-object-builders-v0@0.1.3+e4c9a9c395, fabric-networking-v0@0.1.7+12515ed995
[20:59:28] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8 Source=file:/G:/Games/MultiMC/libraries/net/fabricmc/sponge-mixin/0.8+build.17/sponge-mixin-0.8+build.17.jar Service=Knot/Fabric Env=CLIENT
[20:59:30] [main/INFO]: Setting user: Lupos
[20:59:34] [main/INFO]: [Indigo] Registering Indigo renderer!
[20:59:35] [main/INFO]: Backend library: LWJGL version 3.2.2 build 10
[20:59:44] [main/INFO]: Narrator library for x64 successfully loaded
[20:59:44] [main/INFO]: Reloading ResourceManager: Default, Fabric Renderer API (v1), Fabric Networking Block Entity (v0), Fabric Key Bindings (v0), Fabric Renderer - Indigo, Fabric Containers (v0), Fabric Biomes (v1), Fabric Crash Report Info (v1), Fabric Events Interaction (v0), Fabric API Base, Fabric Rendering (v0), Fabric Rendering (v1), Fabric Rendering Data Attachment (v1), Fabric Resource Loader (v0), Fabric Textures (v0), Fabric Content Registries (v0), Fabric Tag Extensions (v0), Fabric Rendering Fluids (v1), Fabric Registry Sync (v0), Fabric Commands (v0), Fabric BlockRenderLayer Registration (v1), Fabric Mining Levels (v0), Fabric Renderer Registries (v1), Fabric Loot Tables (v1), Fabric Events Lifecycle (v0), Book Command Mod, Fabric API, Fabric Models (v0), Fabric Item Groups (v0), Fabric Object Builders (v0), Fabric Networking (v0)
[20:59:53] [main/INFO]: OpenAL initialized.
[20:59:53] [main/INFO]: Sound engine started
[20:59:53] [main/INFO]: Created: 1024x1024x4 minecraft:textures/atlas/blocks.png-atlas
[20:59:54] [main/INFO]: Created: 256x128x4 minecraft:textures/atlas/signs.png-atlas
[20:59:54] [main/INFO]: Created: 1024x512x4 minecraft:textures/atlas/banner_patterns.png-atlas
[20:59:54] [main/INFO]: Created: 1024x512x4 minecraft:textures/atlas/shield_patterns.png-atlas
[20:59:54] [main/INFO]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas
[20:59:54] [main/INFO]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas
[20:59:54] [main/INFO]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas
[20:59:54] [main/INFO]: Created: 256x256x0 minecraft:textures/atlas/particles.png-atlas
[20:59:54] [main/INFO]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas
[20:59:54] [main/INFO]: Created: 256x128x0 minecraft:textures/atlas/mob_effects.png-atlas
[21:00:37] [main/INFO]: [fabric-registry-sync] Loaded registry data [file 1/4]
[21:00:38] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[21:00:38] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[21:00:38] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[21:00:38] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[21:00:38] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[21:00:40] [main/FATAL]: Reported exception thrown!
net.minecraft.class_148: Starting integrated server
    at net.minecraft.class_437.wrapScreenError(class_437.java:452) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_312.method_1601(class_312.java:86) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_312.method_22686(class_312.java:150) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_1255.execute(class_1255.java:94) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_312.method_22684(class_312.java:150) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar:build 10]
    at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar:build 10]
    at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) ~[lwjgl-glfw-3.2.2.jar:build 10]
    at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:105) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_1041.method_15998(class_1041.java:301) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_310.method_1523(class_310.java:970) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_310.method_1514(class_310.java:585) [intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.client.main.Main.main(Main.java:202) [intermediary-minecraft-1.15.1-client.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_202]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_202]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_202]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_202]
    at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:193) [fabric-loader-0.7.3+build.176.jar:?]
    at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:138) [fabric-loader-0.7.3+build.176.jar:?]
    at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:26) [fabric-loader-0.7.3+build.176.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_202]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_202]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_202]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_202]
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196) [NewLaunch.jar:?]
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231) [NewLaunch.jar:?]
    at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?]
    at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?]
Caused by: java.lang.NoClassDefFoundError: net/minecraft/nbt/Tag
    at com.bookFiller.BookCommands.registerCommand(BookCommands.java:33) ~[BookFiller-1.0.0-dev.jar:?]
    at com.bookFiller.BookCommands.lambda$onInitialize$0(BookCommands.java:25) ~[BookFiller-1.0.0-dev.jar:?]
    at net.minecraft.class_2170.md7edfe3$lambda$addMethods$0$0(class_2170.java:540) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at java.util.ArrayList.forEach(Unknown Source) ~[?:1.8.0_202]
    at java.util.Collections$UnmodifiableCollection.forEach(Unknown Source) ~[?:1.8.0_202]
    at net.minecraft.class_2170.handler$zee000$addMethods(class_2170.java:540) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_2170.<init>(class_2170.java:218) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_1132.<init>(class_1132.java:52) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_310.method_1559(class_310.java:1597) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_528$class_4272.method_20174(class_528.java:379) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_528$class_4272.method_20164(class_528.java:311) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_528$class_4272.mouseClicked(class_528.java:257) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_350.mouseClicked(class_350.java:321) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_4069.mouseClicked(class_4069.java:27) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_312.method_1611(class_312.java:86) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_437.wrapScreenError(class_437.java:447) ~[intermediary-minecraft-1.15.1-client.jar:?]
    ... 27 more
Caused by: java.lang.ClassNotFoundException: net.minecraft.nbt.Tag
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_202]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_202]
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[?:1.8.0_202]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_202]
    at net.fabricmc.loader.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:161) ~[fabric-loader-0.7.3+build.176.jar:?]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_202]
    at com.bookFiller.BookCommands.registerCommand(BookCommands.java:33) ~[BookFiller-1.0.0-dev.jar:?]
    at com.bookFiller.BookCommands.lambda$onInitialize$0(BookCommands.java:25) ~[BookFiller-1.0.0-dev.jar:?]
    at net.minecraft.class_2170.md7edfe3$lambda$addMethods$0$0(class_2170.java:540) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at java.util.ArrayList.forEach(Unknown Source) ~[?:1.8.0_202]
    at java.util.Collections$UnmodifiableCollection.forEach(Unknown Source) ~[?:1.8.0_202]
    at net.minecraft.class_2170.handler$zee000$addMethods(class_2170.java:540) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_2170.<init>(class_2170.java:218) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_1132.<init>(class_1132.java:52) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_310.method_1559(class_310.java:1597) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_528$class_4272.method_20174(class_528.java:379) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_528$class_4272.method_20164(class_528.java:311) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_528$class_4272.mouseClicked(class_528.java:257) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_350.mouseClicked(class_350.java:321) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_4069.mouseClicked(class_4069.java:27) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_312.method_1611(class_312.java:86) ~[intermediary-minecraft-1.15.1-client.jar:?]
    at net.minecraft.class_437.wrapScreenError(class_437.java:447) ~[intermediary-minecraft-1.15.1-client.jar:?]
    ... 27 more
---- Minecraft Crash Report ----
// Uh... Did I do that?

Time: 12/30/19 9:00 PM
Description: Starting integrated server

java.lang.NoClassDefFoundError: net/minecraft/nbt/Tag
    at com.bookFiller.BookCommands.registerCommand(BookCommands.java:33)
    at com.bookFiller.BookCommands.lambda$onInitialize$0(BookCommands.java:25)
    at net.minecraft.class_2170.md7edfe3$lambda$addMethods$0$0(class_2170.java:540)
    at java.util.ArrayList.forEach(Unknown Source)
    at java.util.Collections$UnmodifiableCollection.forEach(Unknown Source)
    at net.minecraft.class_2170.handler$zee000$addMethods(class_2170.java:540)
    at net.minecraft.class_2170.<init>(class_2170.java:218)
    at net.minecraft.class_1132.<init>(class_1132.java:52)
    at net.minecraft.class_310.method_1559(class_310.java:1597)
    at net.minecraft.class_528$class_4272.method_20174(class_528.java:379)
    at net.minecraft.class_528$class_4272.method_20164(class_528.java:311)
    at net.minecraft.class_528$class_4272.mouseClicked(class_528.java:257)
    at net.minecraft.class_350.mouseClicked(class_350.java:321)
    at net.minecraft.class_4069.mouseClicked(class_4069.java:27)
    at net.minecraft.class_312.method_1611(class_312.java:86)
    at net.minecraft.class_437.wrapScreenError(class_437.java:447)
    at net.minecraft.class_312.method_1601(class_312.java:86)
    at net.minecraft.class_312.method_22686(class_312.java:150)
    at net.minecraft.class_1255.execute(class_1255.java:94)
    at net.minecraft.class_312.method_22684(class_312.java:150)
    at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36)
    at org.lwjgl.system.JNI.invokeV(Native Method)
    at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101)
    at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:105)
    at net.minecraft.class_1041.method_15998(class_1041.java:301)
    at net.minecraft.class_310.method_1523(class_310.java:970)
    at net.minecraft.class_310.method_1514(class_310.java:585)
    at net.minecraft.client.main.Main.main(Main.java:202)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:193)
    at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:138)
    at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
    at org.multimc.EntryPoint.listen(EntryPoint.java:143)
    at org.multimc.EntryPoint.main(EntryPoint.java:34)
Caused by: java.lang.ClassNotFoundException: net.minecraft.nbt.Tag
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at net.fabricmc.loader.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:161)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 43 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
    at com.bookFiller.BookCommands.registerCommand(BookCommands.java:33)
    at com.bookFiller.BookCommands.lambda$onInitialize$0(BookCommands.java:25)
    at net.minecraft.class_2170.md7edfe3$lambda$addMethods$0$0(class_2170.java:540)
    at java.util.ArrayList.forEach(Unknown Source)
    at java.util.Collections$UnmodifiableCollection.forEach(Unknown Source)
    at net.minecraft.class_2170.handler$zee000$addMethods(class_2170.java:540)
    at net.minecraft.class_2170.<init>(class_2170.java:218)
    at net.minecraft.class_1132.<init>(class_1132.java:52)

-- Starting integrated server --
Details:
    Level ID: Test
    Level Name: Test
Stacktrace:
    at net.minecraft.class_310.method_1559(class_310.java:1597)
    at net.minecraft.class_528$class_4272.method_20174(class_528.java:379)
    at net.minecraft.class_528$class_4272.method_20164(class_528.java:311)
    at net.minecraft.class_528$class_4272.mouseClicked(class_528.java:257)
    at net.minecraft.class_350.mouseClicked(class_350.java:321)
    at net.minecraft.class_4069.mouseClicked(class_4069.java:27)
    at net.minecraft.class_312.method_1611(class_312.java:86)

-- Affected screen --
Details:
    Screen name: net.minecraft.class_526
Stacktrace:
    at net.minecraft.class_437.wrapScreenError(class_437.java:447)
    at net.minecraft.class_312.method_1601(class_312.java:86)
    at net.minecraft.class_312.method_22686(class_312.java:150)
    at net.minecraft.class_1255.execute(class_1255.java:94)
    at net.minecraft.class_312.method_22684(class_312.java:150)
    at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36)
    at org.lwjgl.system.JNI.invokeV(Native Method)
    at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101)
    at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:105)
    at net.minecraft.class_1041.method_15998(class_1041.java:301)
    at net.minecraft.class_310.method_1523(class_310.java:970)
    at net.minecraft.class_310.method_1514(class_310.java:585)
    at net.minecraft.client.main.Main.main(Main.java:202)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:193)
    at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:138)
    at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
    at org.multimc.EntryPoint.listen(EntryPoint.java:143)
    at org.multimc.EntryPoint.main(EntryPoint.java:34)

-- System Details --
Details:
    Minecraft Version: 1.15.1
    Minecraft Version ID: 1.15.1
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_202, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 2700449704 bytes (2575 MB) / 4143972352 bytes (3952 MB) up to 7516192768 bytes (7168 MB)
    CPUs: 4
    JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xms1536m -Xmx8064m
    Fabric Mods: 
        bookfiller: Book Command Mod 1.0.0
        fabric: Fabric API 0.4.26+build.283-1.15
        fabric-api-base: Fabric API Base 0.1.2+b7f9825d95
        fabric-biomes-v1: Fabric Biomes (v1) 0.1.5+3b05f68e95
        fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.4+c6a8ea8995
        fabric-commands-v0: Fabric Commands (v0) 0.1.2+b7f9825d95
        fabric-containers-v0: Fabric Containers (v0) 0.1.3+b7f9825d95
        fabric-content-registries-v0: Fabric Content Registries (v0) 0.1.3+b7f9825d95
        fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.1.2+b7f9825d95
        fabric-dimensions-v1: fabric-dimensions-v1 0.2.3+06c939b395
        fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.2.6+12515ed995
        fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.1.2+b7f9825d95
        fabric-item-groups-v0: Fabric Item Groups (v0) 0.1.6+ec40b2e195
        fabric-keybindings-v0: Fabric Key Bindings (v0) 0.1.1+dfdb52d695
        fabric-loot-tables-v1: Fabric Loot Tables (v1) 0.1.5+e08a730595
        fabric-mining-levels-v0: Fabric Mining Levels (v0) 0.1.1+b7f9825d95
        fabric-models-v0: Fabric Models (v0) 0.1.0+dfdb52d695
        fabric-networking-blockentity-v0: Fabric Networking Block Entity (v0) 0.2.3+e08a730595
        fabric-networking-v0: Fabric Networking (v0) 0.1.7+12515ed995
        fabric-object-builders-v0: Fabric Object Builders (v0) 0.1.3+e4c9a9c395
        fabric-particles-v1: fabric-particles-v1 0.1.1+dfdb52d695
        fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.2.6+f3d8141b95
        fabric-renderer-api-v1: Fabric Renderer API (v1) 0.2.7+f3d8141b95
        fabric-renderer-indigo: Fabric Renderer - Indigo 0.2.21+175d0eb895
        fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 2.0.1+5a0f9a6095
        fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.1.3+b7f9825d95
        fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 0.1.6+12515ed995
        fabric-rendering-v0: Fabric Rendering (v0) 1.1.0+5341049095
        fabric-rendering-v1: Fabric Rendering (v1) 0.1.0+5341049095
        fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.1.10+06c939b395
        fabric-tag-extensions-v0: Fabric Tag Extensions (v0) 0.1.3+abd9158095
        fabric-textures-v0: Fabric Textures (v0) 1.0.4+821cdba795
        fabricloader: Fabric Loader 0.7.3+build.176
        minecraft: Minecraft 1.15.1
    Launched Version: MultiMC5
    Backend library: LWJGL version 3.2.2 build 10
    Backend API: GeForce GTX 1050 Ti/PCIe/SSE2 GL version 4.5.0 NVIDIA 385.54, NVIDIA Corporation
    GL Caps: Using framebuffer using OpenGL 3.0
    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'fabric'
    Type: Client (map_client.txt)
    Resource Packs: 
    Current Language: English (US)
    CPU: 4x Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
#@!@# Game crashed! Crash report saved to: #@!@# G:\Games\MultiMC\instances\1.15.1 fabric - own mod\.minecraft\crash-reports\crash-2019-12-30_21.00.40-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Process exited with code -1.

gradle.properties:

# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
    # check these on https://fabricmc.net/use
    minecraft_version=1.15.1
    yarn_mappings=1.15.1+build.18
    loader_version=0.7.3+build.176

# Mod Properties
    mod_version = 1.0.0
    maven_group = com.book.filler
    archives_base_name = BookFiller

# Dependencies
    # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
    fabric_version=0.4.26+build.283-1.15

建筑格雷德尔:

plugins {
    id 'fabric-loom' version '0.2.6-SNAPSHOT'
    id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

minecraft {
}

dependencies {
    //to change the versions see the gradle.properties file
    minecraft "com.mojang:minecraft:${project.minecraft_version}"
    mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
    modCompile "net.fabricmc:fabric-loader:${project.loader_version}"

    // Fabric API. This is technically optional, but you probably want it anyway.
    modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

    // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
    // You may need to force-disable transitiveness on them.
}

processResources {
    inputs.property "version", project.version

    from(sourceSets.main.resources.srcDirs) {
        include "fabric.mod.json"
        expand "version": project.version
    }

    from(sourceSets.main.resources.srcDirs) {
        exclude "fabric.mod.json"
    }
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
    classifier = "sources"
    from sourceSets.main.allSource
}

jar {
    from "LICENSE"
}

// configure the maven publication
publishing {
    publications {
        mavenJava(MavenPublication) {
            // add all the jars that should be included when publishing to maven
            artifact(remapJar) {
                builtBy remapJar
            }
            artifact(sourcesJar) {
                builtBy remapSourcesJar
            }
        }
    }

    // select the repositories you want to publish to
    repositories {
        // uncomment to publish to the local maven
        // mavenLocal()
    }
}

织物摩登派青年json:

{
  "schemaVersion": 1,
  "id": "bookfiller",
  "version": "${version}",

  "name": "Book Command Mod",
  "description": "This mods allows you to fill books with text!",
  "authors": [
    "Lupos"
  ],
  "contact": {
    "homepage": "https://fabricmc.net/",
    "sources": ""
  },

  "license": "MIT",
  "icon": "assets/modid/communism-icon.png",

  "environment": "*",
  "entrypoints": {
    "main": [
      "com.bookFiller.BookCommands"
    ]
  },
  
  "depends": {
    "fabricloader": ">=0.7.2",
    "fabric": "*",
    "minecraft": "1.15.x"
  },
  "suggests": {
    "flamingo": "*"
  }
}

这就是我的文件夹结构:
[![在此处输入图像描述][1][1]

共有1个答案

王云
2023-03-14

看起来你是在一个没有使用Minecraft服务器依赖项的环境中开发你的mod,并且你没有在代码中重新混淆对Minecraft类的引用(因此,java.lang.NoClassDefFoundError:net/Minecraft/nbt/Tag)。通常,这种重新混淆会在Moded server软件社区提供的任何示例mod项目中自动设置,因此您可以从那里简单地复制它。也有可能您根本没有使用Gradle,而是使用了Eclipse导出之类的东西。这根本不起作用,因为它跳过了这个重新混淆的任务。

要在Windows上构建您的mod,请在mod的目录中打开cmd.exe并运行gradlew build

 类似资料:
  • 我已经寻找了一段时间来解决这个问题。我的工作区中有一个项目文件夹(该文件夹基本上是我的根目录),其中有一个名为icon的文件。gif。在我的项目中,我有以下几点: 当我运行图标时,它在eclipse中运行良好,但导出的jar文件并不像在eclipse中那样显示图标。知道为什么吗?我想弄明白这件事快疯了。

  • 当我在Eclipse中运行它时,它会显示图片,但当我将其导出到.jar文件时,它只是显示一个空白窗口。

  • 正在更新属性文件:/home/mehmet/works/netbeansprojects/hsm_java/build/built-clean.属性删除目录/home/mehmet/works/netbeansprojects/hsm_java/build 清洁: 初始化: 已创建目录:/home///netbeansprojects/hsm_java/build/empty 已创建目录:/hom

  • 我试图使用Ubuntu 16.04在亚马逊AWS上部署我的Django项目。我正在运行python版本2.7.12和Django 1.10.5。我创建了名为venv的虚拟环境,然后激活了它。我得到这个错误,当我试图运行pythonmanage.pyrunserver。 Traceback(最近一次调用最后一次):文件"manage.py",第17行,在"不能导入Django。你确定它安装和"重要错

  • 我尝试将我的一个IntelliJ项目导出到.jar中,如果我在consol(java-jar name.jar)中运行.jar 它显示缺少JavaFX运行时,但这是必需的。如果我开始我的项目在IntelliJ它工作一切良好。 IntelliJ终极2020.1。 请耐心等待,这是我第一个自己的java项目和第一个fx应用程序, 也是我第一次尝试创建JAR。 我把一些设置的屏幕截图放在下面(链接)。

  • 我在将java文件导出到可运行的jar文件时遇到了问题。在eclipse中,它工作得很好,但是当我导出它时,它就不工作了。 我已经尝试过(java-jar myjar.jar)获取日志,但它说“无法访问jar文件” 因为当我将它放在注释中时,当我导出时,它运行,但没有映像。 我也尝试过这样的方法:,但它也不起作用。我做错了什么?如何导出JLabel上带有图像的可运行jar文件? (这是我的JLab