Jump to content

Recommended Posts

Posted

Hi All,

Was hoping to get a bit of help here. Or to know if what i want to do is even possible (which i'm sure it must be).

 

is it at all possible to create mod resources at run-time; that is to say create the blockstate / models / textures at launch. 

 

These will all be based off templates. 

 

From what i gather (looking at ForgeDocs) i will need to create a new ResourceLocation? 

I'm a bit stuck in how I should go about doing this.

Thanks in advanced. 

 

- Jay

 

Posted (edited)

What do you want to use these resources for?

Its completely possible to autogenerate your resources using gradle it in your development workspace, but you would never want to do it in production

Edited by Cadiboo
  • Thanks 1

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted (edited)

I have been working on a mod for mod-pack developers. See here 

 

The idea is to supply the mod a payload (currently json, eventually zip). And the Block & Items will be added at runtime.

 

The blocks & Items added are just basic ones. mainly used in crafting recipes or decoration. 

I have the bulk of it working. its just adding the resources that I'm struggling with. 

 

Thanks for taking the time to reply ?

Edited by TheJays
Posted
  On 6/25/2019 at 10:40 AM, Cadiboo said:

Its completely possible to autogenerate your resources using gradle it in your development workspace, but you would never want to do it in production

Expand  

Is this an implication that it is not possible to do while forge is loading? 

 

Thanks ?

Posted

You’re able to go around the JSON system and directly baked models etc. but the entire point of the JSON system is to make everything accessible to and modifiable by end-users. I think that your users make the jsons themselves would be the best choice. 

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

Well see.. That was the route i was starting to take; the end user would just supply a resource pack.

 

However (unless I'm doing something else wrong) Upon loading the resource pack the lang entries work, but models & textures do not. 

 

I  cant see if Forge needs to at least initiate some resources before adding a resource pack.  

Posted

Every mod is it’s own resource pack and data pack

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

Sorry I should have been clearer. 

I was referring to adding a resourcepack.zip to the games ./resourcepacks folder. 

Doing this has resolved my issue. ( i mush have made an error with the pack format)

I just need to find out how to apply a pack by default now. 

Thanks ?

Posted

I highly recommend not doing what you’re doing.

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

Why is that? 

I feel its a good idea for those who just want to add blocks and items. And don't want or know how to create an entire mod to add them.

 

The Mod is actually working great now, and doesn't add much to the launch time after the first launch (providing the user doesn't add/change files)

Posted

I'm not against having blocks + items load from JSON, I think that its a great idea and I've been planning on doing something like it that would also allow the blocks/items to be added when the player joins a server. I'm against mods creating json files in production. These files defeat the purpose of the JSON system altogether and do not allow resource packs/data packs from users/modpack makers to change enhance the look of the blocks.

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

I'm all about choice, and I completely agree that taking away control from the user is always a bad idea. but i have to stress that my mod wont do everything. and still allows the users to add their own textures etc.

Take a look at the mod its self - https://github.com/TheJaysH/BiarMod

 

It currently it has 2 options in terms of adding the blocks & Items.

1) supply it a zip with the json payload, and textures
2) just supply the json.

The first option will create the ResoricePack.zip from the textures the users supplied - and apply it.
The second will just add the blocks & Items, which leaves the Resources down to the user.

the json is as follows:
 

{
  "TABS": [
    {
      "langName" : "Example Tab",
      "unlocalizedName" : "tabExample",
      "icon" : ""
    }
  ],
  "BLOCKS": [
    {
      "langName" : "Example Block",
      "unlocalizedName": "exampleBlock",
      "registryName" : "example_block",
      "tabIndex" : 0,
      "hardness" : 1.5,
      "soundType" : "STONE",
      "material" : "ROCK"
    }
  ],
  "ITEMS": [
    {
      "langName" : "Example Item",
      "unlocalizedName": "exampleItem",
      "registryName" : "example_item",
      "tabIndex" : 0,
      "maxStackSize" : 16
    }
  ]

 

And this is the Zip file structure (should they choose to use it)

`biar.json` is the aforementioned json file
 

.minecraft/
    |
    |__ biarmod/
        |
        |__ biarmod.zip
            |
            |__biar.json
            |
            |__textures/
                |
                |__items/
                |   |
                |   |__example_item.png
                |
                |__blocks/
                    |
                    |__ example_block.png

 

 

The idea of option 1 is a one size fits all solution for mod pack developers who just want blocks & items with one texture who may not have the know-how to create a full ResourcePack.zip

And my vision down the line, is to have a comunity repo for "block-packs" or "item-packs" so users can download a set of blocks and items made by the community. 

 

The main push for this idea came from a modpack developer i know who wanted me to add a bunch of items to the pack - they were just used for crafting recipes and noting more. That gave me the idea to create this. 

Posted

Looks pretty good.

I would change a couple things - the registry name & unlocalised name should be the same and it looks like you’re only providing English translations.

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

currently im only working with English. 

 

Lang will soon be its own node with different entries like so:

 

{
  "lang": {
    "en_us" : "The Blah",
    "br_fr" : "Lé Bláh"
    ...
  }
}

 

 

As for the naming convention; i was considering  having only one name.. however i'd prefer to stick to the convention of snake_case for registry and camelCase for unlocalised

Posted
  On 6/27/2019 at 8:03 AM, TheJays said:

however i'd prefer to stick to the convention of snake_case for registry and camelCase for unlocalised

Expand  

Unlocalised names/translation keys were made the same as registry names in 1.13.

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

Er no, snake case. It’s done automatically - setUnlocalisedName/setTranslationKey no longer exists

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hey there! I removed Bobby as Pyralis suggested and found that I still had that and a another closely related bug (or same bug, different presentation) wherein a torch only illuminates its own block and gets smoothed 1 block out, then gone.   After comparing your modlist to mine (I'm on fabric, also 1.20.1) I found we had 2 mods with the same versions. Mine || Yours Bobby-5.0.1.jar ||bobby-1.20.1_v5.0.1.jar ImmediatelyFast-Fabric-1.2.17+1.20.4.jar || ImmediatelyFast-Forge-1.2.17+1.20.4.jar Removing ImmediatelyFast.. immediately (😉) seems to have fixed the issue. Since it's client only- no new world needed either! To note, I also removed all mods related to or containing direct requirements for Sodium, Indium and Iris which may have played a role, I did not test with re-adding.
    • For anyone still looking for the equivalent for 1.19.2+, the render type should be set for the model. In datagen, this can be done by using ModelBuilder::renderType, otherwise just add the line directly to the json file. As for the validity of this question, the idiomatic solution is presented nowhere online; ModelBuilder::renderType is never addressed when discussing block render types meaning that the solution I have provided is the first mentioned usage. Furthermore, there are no external references to this function meaning that to discover its existence requires a deep search through Forge's code. Therefore it is not only understandable but expected that most beginner modders would struggle to find this function given the already poor documentation of Forge's API.
    • Same issue without voicechat?
    • Start by following the docs to get a workspace setup: https://docs.minecraftforge.net/en/latest/gettingstarted/ Then poke around some of the tutorials, https://www.mcjty.eu/docs/1.20/ used to be the goto, but not sure if there are any updates for regular forge or not, but if you've brushed up on Java, it will be enough to get you started. Poke around the Minecraft and Forge sources to see how things are done. Read the FAQ for information on how to post code/logs when you run into issues. Share as much info on issues you have as possible. Use github to host projects, chances of someone helping are higher when they can actually see all your code and/or build it themselves. And finally, keep it on the forums, don't direct message people with questions, most people do not provide personal support like that. Also keep in mind forums posts are not always immediately answered, if you're looking for a quicker response, you can always try the Minecraft Forge discord server.
    • Hello, I have a Forge Minecraft sever (I host it at g-portal.com) which has always worked fine and I had no problems, but today it doesn't wanna work anymore. Today I started the server and the status said online, but after a few seconds it said this: "Start failed". And then out of nowhere it restarted itself and the same thing happened again and again and now it's in an infinite loop where it just keeps failing and then restarts. Here's the download link for the server logs: https://www.mediafire.com/file/sq30dgoonjevib1/2025-07-06-1.log/file Does anyone know how to fix this? If yes I would really appreciate help. Best wishes, Gabs1107
  • Topics

×
×
  • Create New...

Important Information

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