MarkusBordihn / BOs-Easy-NPC

Create easily NPC for your world or for your mod.
Other
19 stars 7 forks source link

[Feature Request] Custom models maybe over the Entity Wizard #152

Open SniffSniff125 opened 5 months ago

SniffSniff125 commented 5 months ago

i would like to know if its possible for someone to add/replace a model without having the code of this mod (and the skills to edit it). for example, i have a .cpm file, but i also have the blockbench (.bb) 3d model, i can convert it to json/java my first guess was replacing a model like the skeleton, but the files are multiple and also .class i also tried with a resource pack, using an optifine feature for custom entity models (cem), but it needs to start from a default vanilla mob, and does not seem to be able to edit modded entities' models.

if there is a way, i would like to know it, as i have been basically bashing my head against a wall since i have opened the previous issue, as the first thing that came to my mind as soon as i found the mod was: "an architect village would look cool" i lack all but the most basic of modding knowledge, i can easily replace, rename files and create resource packs, but i have no experience with mods (without the use of mcreator)

(the model was made by my friend, not by me) imageedit_1_8852840477

thanks and sorry for bothering (again)

MarkusBordihn commented 5 months ago

Thanks for your question and lets say it's complicated.

All of the original models are hard-coded directly in the Java files and will be constructed during the game load like:

    // Head
    PartDefinition head =
        partDefinition.addOrReplaceChild(
            "head",
            CubeListBuilder.create()
                .texOffs(26, 17)
                .addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new CubeDeformation(0.0F))
                .texOffs(0, 0)
                .addBox(-4.5F, -8.5F, -4.5F, 9.0F, 8.0F, 9.0F, new CubeDeformation(0.0F))
                .texOffs(27, 0)
                .addBox(-4.5F, -4.0F, -5.0F, 9.0F, 5.0F, 4.0F, new CubeDeformation(0.0F))
                .texOffs(0, 0)
                .addBox(-1.0F, -4.0F, -5.0F, 2.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)),
            PartPose.offset(0.0F, 0.0F, 0.0F));

This means the game itself only supports such Java Models and is not able to load any custom files.

Blockbench could provide you this kind of code, so for example I created the Orc model with Blockbench like: https://github.com/MarkusBordihn/BOs-Easy-NPC/blob/1.20.1/models/orc.bbmodel

To make sure such model is displayed correctly you need to define how the animation looks, how the models will be textured and all the other stuff which is not directly available just from a model file.

For this reason it's not possible to easily import a Blockbench model directly to the game.

Technically you could use something like https://www.curseforge.com/minecraft/mc-mods/json-entity-models-jems but it seems that the project is not longer maintained or updated.

Let me put this on the roadmap to see if I can do an integration with the Entity Wizard like: https://learn.microsoft.com/de-de/minecraft/creator/documents/minecraftentitywizard

Starfire1147 commented 2 months ago

So, as 5.X.X is now released in beta, what's the current status? I see you moved it to the "In review", but what does it mean? Are there any functionality as of right now, or is it just a tag for you to work on?

MarkusBordihn commented 2 months ago

Basically there is already a feature which could be used for this, see: https://github.com/MarkusBordihn/BOs-Easy-NPC/wiki/CustomModels

I currently trying to improve the support and adding this directly to the UI instead of the command line. However there are some related issues, so you could try the current feature but there will be bugs.

"In review" means that I need to check if it is feasible or what kind of alternatives I could offer. Supporting the Entity Wizard is something which requires more work, but displaying custom models from other mods or so, is already limited supported.