Jump to content

[1.8+] Using Forge's built-in update checker.


Geforce

Recommended Posts

Hello everyone,

 

Today, I'm going to show you how to use Forge's built-in version update checker found in v11.14.3.1549 and later.

 

First, create an update.json file.

 

 

First, you will need to create an update.json file. Forge will use that to compare versions, provide the correct changelogs, provide a link to the download page, and such. LexManos has already created an example .json file which you can look at here. Let's run through the format used in that file:

 

NOTE: If you want, you can copy Lex's file, and replace values while you read.

 

NOTE 2: Currently, only Forge for Minecraft 1.8 has this feature. Although I show you how to have builds for multiple versions of Minecraft, you will only need to do this when Forge for Minecraft 1.8.8 or 1.9 comes out.

 

"homepage" is the URL that Forge will display when someone uses an out-of-date version of your mod. I personally use the link to my CurseForge 'files' page here.

 

"promos" is where you define the "latest" and "recommended" versions of your mod for the version of Minecraft you're using,

and the changelogs for them. Create "{MinecraftVersion}-latest" and "{MinecraftVersion}-recommended" keys, replacing "{MinecraftVersion}" with the version of Minecraft it's for. For the value, type the version of your mod you want to use. This format

sort of follows Forge's build system, "latest" is the newest version available, and "recommended" is the latest stable build. You may have keys for multiple versions of Minecraft as well, as shown below.

 

So far, your file should look something like this:

 

 

 

"homepage": "http://minecraft.curseforge.com/mc-mods/64760-securitycraft-mod/files",
  "promos": {
    "1.7.10-latest": "v1.8.0",
    "1.7.10-recommended": "v1.7.1",
    "1.8-latest": "v1.8.0",
    "1.8-recommended": "v1.7.1"
  },

 

 

 

Next, you may define the changelogs for each version. Create a new array, like this. Again, replace {MinecraftVersion} with the version of Minecraft you're defining:

 

  // Snipped...
    "1.8-recommended": "v1.8.0"
  },
  "{MinecraftVersion}: {
    "v1.8.0": "changelog"
  }

 

Once you've done that, define the changelog for each version that you use, with your mod's version as the key. You may have changelogs for multiple versions in the array as well. Use "\n" if you want to go to a new line.

 

Example:

"1.7.10: {
    "v1.8.0": "This is the changelog for v1.8.0 for MC 1.7.10 of my mod!\nNew blocks, items, and more.",
    "v1.7.1": "This is the changelog for v1.7.1 for MC 1.7.10 of my mod!\nTons of new bugfixes!"
  },
"1.8: {
    "v1.8.0": "This is the changelog for v1.8.0 for MC 1.8 of my mod!\nNew blocks, items, and more.",
    "v1.7.1": "This is the changelog for v1.7.1 for MC 1.8 of my mod!\nTons of new bugfixes!"
  }

 

You may add as many versions as you want. Once you're done, move on to the next step.

 

 

 

Lastly, add the URL of your newly created file to your @Mod annotation.

 

 

After you've created your update .json file, upload it to a server, and get the URL for it. If you don't have your own website or server, Github is a great alternative. Simply push the file to your Github repository, and copy the raw link to it (should look something like https://www.github.com/Geforce/MyRepo/raw/master/update.json).

 

Finally, once you've copied the link, simply paste it into your @Mod annotation with "updateJSON" as the key, like this:

 

@Mod(modid = "mymod", name = "My mod!", version = "v1.7.1", updateJSON = "{LINKHERE}")

 

 

 

...And you're done! If someone uses an outdated version of your mod, Forge will show a download link and changelog for the new version, using the info you've provided.

 

Hope this helps!

  • Thanks 1

Potato's have skin. I have skin. Therefore, i am a potato.

 

Follow me on Twitter!

http://www.twitter.com/I_Mod_Minecraft

Link to comment
Share on other sites

  • 1 month later...

I'm trying to do that except I am using gist. Would that cause a problem? The game isn't listing that I have a new version available even though I made a dummy new version entry into the JSON file.

My files are here:

https://github.com/KaminoCoding/CommuMod/blob/develop-1.8/src/main/java/io/cyb3rwarri0r8/commumod/Commumod.java#L57

https://gist.github.com/Cyb3rWarri0r8/bc388f17e518a76e3b17

 

TLDR;

It's not working with a raw gist link from the file hosted on Github and I have no idea what could be wrong.

Link to comment
Share on other sites

The problem with gist is that the raw links include the hashses for the file itself so it literally will never update because the server will see it as a different file and make it a different link, so dont use gist.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.