Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

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


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 post
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 post
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.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to post
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.

Guest
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.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • And also if u could help create a server with forge 
    • package com.example.examplemod; import java.util.Collection; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; @Mod(modid = "PartyAll", name = "PartyAll", version = "1.0", acceptedMinecraftVersions = "[1.16.X]") public class ExampleMod extends CommandBase {   @EventHandler   public void init(FMLPostInitializationEvent event) {     MinecraftForge.EVENT_BUS.register(this);     ClientCommandHandler.instance.func_71560_a((ICommand)this);   }      public int func_82362_a() {     return 0;   }      public String func_71517_b() {     return "pall";   }      public String func_71518_a(ICommandSender sender) {     return null;   }      public void func_71515_b(ICommandSender sender, String[] args) throws CommandException {     (new Thread(() -> myRun(sender))).start();   }      public void myRun(ICommandSender sender) {     Collection<NetworkPlayerInfo> playersC = Minecraft.func_71410_x().func_147114_u().func_175106_d();     playersC.forEach(loadedPlayer -> {           String loadedPlayerName = loadedPlayer.func_178845_a().getName();           (Minecraft.func_71410_x()).field_71439_g.func_71165_d("/p " + loadedPlayerName);           try {             Thread.sleep(150L);           } catch (InterruptedException e) {             e.printStackTrace();           }          });   } @Override public String getCommandName() {     // TODO Auto-generated method stub     return null; } @Override public String getCommandUsage(ICommandSender sender) {     // TODO Auto-generated method stub     return null; } @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException {     // TODO Auto-generated method stub      } }  
    • Now that i'm using 1.16 it still gives me errors with the func_ note: I'm not a professional
    • I am installing forge but then it changes it in WinRar version and then i cant do anything with it please help 😪
    • The darkness is associated with ambient occlusion, in your block class you can modify this with: @Override public float getAmbientOcclusionLightValue(BlockState state, IBlockReader worldIn, BlockPos pos) { return (some float); } I've found that small values (usually around 0.1F) reduce the dark. Alternatively in your block model json you can disable or enable occlusion with: "ambientocclusion": true/false  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.