首页 > 解决方案 > minecraft .toml 文件错误:我该如何解决?

问题描述

我正在尝试创建自己的 Minecraft mod,但他发送了一个错误:

这里的 .toml 文件代码:

modLoader="javafml" #mandatory

loaderVersion="[36,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.

license="All rights reserved"

#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional

[[mods]] #mandatory

modId="buildable_kingdoms" #mandatory

version="1.16.5-1.0.0" #mandatory

displayName="Buildable Kingdoms" #mandatory

#updateJSONURL="https://change.me.example.invalid/updates.json" #optional

#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional

logoFile="" #optional

credits="Thanks to Bl4ckdestinyXX" #optional

authors="Bl4ckdestinyXX" #optional
# The description text for the mod (multi line!) (#mandatory)
description='''
there is no description
'''

[[dependencies.buildable_kingdoms]] #optional

    modId="forge" #mandatory

    mandatory=true #mandatory

    versionRange="[36,)" #mandatory

    ordering="NONE"

    side="BOTH"

[[dependencies.buildable_kingdoms]]
    modId="minecraft"
    mandatory=true

    versionRange="[1.16.5,1.17)"
    ordering="NONE"
    side="BOTH"


这是我的 Main.java 代码:(我已经删除了所有导入的东西)

@Mod()
public class Main 
{
    public static Main instance;
    public static final String MOD_ID = "buildable_kingdoms";
    public static final Logger LOGGER = LogManager.getLogger();
    
    public Main()
    {
        instance = this;
        
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup);
    }
}

错误是:

mods.toml 缺少 modid null 的元数据

标签: javaminecraftmod

解决方案


推荐阅读