Skip to content

Version placeholder ${version} not expanded in fabric.mod.json #2

@lyuwenhan

Description

@lyuwenhan

Title: Version placeholder ${version} not expanded in fabric.mod.json

Hi,

When loading the mod on Fabric Loader 0.18.4 (Minecraft 1.21.11), the following warning appears:

Mod free-inventory uses the version ${version}
Could not parse version number component '${version}'

It looks like the version field in fabric.mod.json was not expanded during build, and still contains the placeholder:

"version": "${version}"

Because of this, Fabric Loader cannot parse the mod version using extended SemVer format.

Environment:

  • Minecraft 1.21.11
  • Fabric Loader 0.18.4
  • Java 21

Suggested fix:
Ensure that the version property is properly expanded during the Gradle build, for example:

processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

This does not affect functionality, but it produces a warning at startup and prevents proper semantic version handling.

I will submit a PR to address this.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions