Jump to content

[1.15.1] Get a json model part in a java class ?


DragonITA

Recommended Posts

import mod.dragonita.fantasymod.resources.assets.fantasymod.model.HatModel

public class Test(){
 public static HatPart = HatModel.HatPart1;
}

Good afternoon, I was wondering if it is possible to get a part of a model in a Java class. I have a Json Model and I want to animate a certain part of it. Now the big question: would this code work (see below)?

 

 

 

If yes or no then let me know. If I have done something wrong please tell me. Thanks for reading it.

P.S.: I am writing this from a mobile device, just for info.

New in Modding? == Still learning!

Link to comment
Share on other sites

On 1/14/2020 at 1:38 AM, DragonITA said:

I have a Json Model and I want to animate a certain part of it.

On 1/14/2020 at 1:38 AM, DragonITA said:

If yes or no then let me know

Short answer: No.

Long answer: Json models are loaded and baked into objects that can easily be uploaded to your GPU for rendering. It is possible to animate these models but it is hard. What exactly are you trying to do, from a player's perspective?

 

  • Like 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

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)

Link to comment
Share on other sites

I want to animate an entity with an OBJ model. You said yourself that you can use an OBJ model with a Json file. So, I want to animate my model with that too, that means that I will write in the Json file which model I want to use, then write the parts that are in the model and that I want to animate and then I will be able to animate it with that too. So I would say from the player perspective.

New in Modding? == Still learning!

Link to comment
Share on other sites

4 hours ago, Cadiboo said:

What exactly are you trying to do, from a player's perspective?

By this I meant something like "Make a campfire that has animated flames"

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

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)

Link to comment
Share on other sites

I did this by splitting my entity into separate models and rendering them with separate rotations etc. You can make your own animation system if you want though (Pixelmon Generations has something you can use IIRC).

  • Like 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

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)

Link to comment
Share on other sites

Thanks for that information, but there's only one question left: Did your entity have an OBJ file or a normal Json file? I would like to get an OBJ file thanks to the help of a Json file, as for the OBJ Block Models, but I would like to know how you did it if your entity had an OBJ Model or if you just did it with a Classic Java file?

New in Modding? == Still learning!

Link to comment
Share on other sites

10 hours ago, DragonITA said:

Did your entity have an OBJ file or a normal Json file?

My entity had 3 json models. But json, obj & b3d models all get turned into the same BakedModels for rendering so it doesn't matter.

10 hours ago, DragonITA said:

How did you do it if your entity had an OBJ Model? Or did you just do it with a Classic Java file?

I did it by loading the models, loading & stitching their textures, baking the models and then rendering them in my renderer.

  • Thanks 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

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)

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.



×
×
  • Create New...

Important Information

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