嘿,我正在尝试学习如何使用 Fabric mod loader 在 VScode 中编写 minecraft mods。但是我一直遇到同样的问题,我无法打开我的世界测试客户端。它一直在崩溃。我尝试重新编写上次成功运行后添加的所有代码。这是我的代码:
package net.my.first.mod;
import net.fabricmc.api.ModInitializer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.block.Block;
public class MyFirstMod implements ModInitializer {
public static final Item FABRIC_ITEM = new FabricItem(new Item.Settings().group(ItemGroup.MISC), null);
public static final Block FABRIC_BLOCK = new FabricBlock(new Item.Settings().group(ItemGoup.MISC), null);
@Override
public void onInitialize() {
Registry.register(Registry.ITEM, new Identifier("myfirstmod", "fabric_item"), FABRIC_ITEM);
Registry.register(Registry.BLOCK, new Identifier("myfirstmod", "fabric_block"), FABRIC_BLOCK);
}
}
提前感谢任何人能够提供的任何帮助!