Jump to content

[1.15.2] Generating JSON Files isn't working; how to use ItemModelProvider ?


Recommended Posts

Posted

Hi guys!

 

I want to generate my json files within my code because it would take too long to do it all by hand.

Before noticing that forge provides some useful classes / interfaces, I wrote some code myself which I thought would work... but it doesn't.

I don't really know why, and I am super obwhelmed by forge's classes / interfaces for this purpose, so if someone would share some insight on ItemModelProvider and which methods are important, I'd be delighted!

Do I need a modelBuilder, modelLoader and modelProvider? What about the DataGenerator?

 

My code

The main mod class:

https://github.com/celinemargaux/Plantastic/blob/crop-experiments/src/main/java/com/celinemargaux/plantastic/Plantastic.java

 

the init class with nested json:

https://github.com/celinemargaux/Plantastic/blob/crop-experiments/src/main/java/com/celinemargaux/plantastic/init/Init.java

 

my assets:

https://github.com/celinemargaux/Plantastic/tree/crop-experiments/src/main/resources/assets/plantastic

 

Thanks in advance!

Celine

Posted

Hi

I guess you're talking about json models for blocks or items?

If this is just a once-off thing, I would personally use Excel (with formulas to copy the right words into the right places in the file) and then export as text.

 

I would also get my mod working perfectly with just one item/block first.  And then when I had ironed out all the bugs, I would add all the remaining items/blocks.

 

-TGG

Posted

Sorry for the late response!

Yes, it's for generating the object_name.json files!
Okay, I could do that, but in the long run I'd like to understand that as well.

I will definitely work on the core code of my mod before making more things, you're right.

 

Thanks for your answer,

 

Celi

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.