Working directory: all custom entity files will be placed into assets/minecraft/optifine/cem in your resourcepack.
jem Files:
A jem file is required when entity modelling, it is the main file which specifies how to re-model an entity.
You simply need to create a jem file named as the entity that you want to have a custom model, ie zombie.jem.
A full list of entities and the names of the files can be found in the optifine's jem documentation along with a list of parts which can be replaced in each entity.
jem stands for JSON Entity Model, meaning that the file must be written in valid JSON.
Firstly "models" is a required parameter which is an array, it will contain objects which then contain models and which parts they replace.
"models": [
{
"part": #part,
#model
}
]
#part must be replaced with one of the parts specified in the optifine's jem documentation. ie "head", "body", "leg1".
#model can be replaced one of two things, you can use a jpm file, or you can specify the model in-line by creating the elements within the jem file itself.
You can replace #model with elements (explained further down), or with "model": "file_name.jpm".
There is some other values that will come in handy which are: "attach": < true | false >, "translate": [x, y, z], "rotate": [x, y, z].
"attach" will default to false if left out, but if set to true will add the model to the part specified rather than replacing it.
"translate" will move the element the number of pixels on the specified axes.
"rotate" will rotate the element on the axes the amount of degrees.
jpm Files:
jpm stands for JSON Part Model, which means that the file must be valid JSON. jpm files must be located within the optifine/cem folder.
A jpm file is purely a part which can consist of multiple elements which can then be used by jem files when replacing parts.
These files do not need to have specific names. But you need to create at least one element.
Instead of writing jpm files by hand, Cubik Studio (~ €20), a modelling program which supports Minecraft json block models, also has the ability to export jpms from the program itself.
You can also use blockbench a free block modelling program, which can be downloaded or used online, which can also export optifine jpms.
This means you won't have to write a jpm by hand but can just create and export models from Cubik Studio or blockbench.
This is a basic method of creating elements, note that "coordinates" works quite differently from that when block modelling. The first three values are the location of the element, the next three are actually the width, height and depth.
"coordinates": [0, 0, 0, 2, 2, 2]
"coordinates": [3, 4, 0, 2, 2, 2]
Both of these elements will be the same size but will be in different places.
Texturing Elements:
There is two ways to texture elements but first you need to specify the texture that will be used by the element by specifying the path following assets/minecraft ie, "texture": "textures/entity/pig/pig.png". You also need to put the size of the texture in pixels ie, "textureSize": [64, 32].
When texturing an element you can specify the uv mapping of individual faces with: "uvUp", "uvDown", "uvNorth", "uvEast", "uvSouth", "uvWest".
ie "uvUp": [0, 0, 4, 6]. The first two numbers are the most top left coordiante of the area you want to have the texture then the next two will be the opposite most right down corner.
The second method is to use "textureOffset" which works with a unwrapped box texture layed out in this specific format. You specify one set of coordinates which is the most top left coordinates of the rectangle drawn around the unwrapped box. From this example the coordinates would be [0, 0], ie "textureOffset": [0, 0].
Animations:
Custom animations can be applied to each part of the entity, they are created by mathematical equations located within the jem file for mobs. You can read the optifine documentation on animations for more information.
The animation equations used for custom animations are located within an object, within an array called "animations" which will be inside the object within the "models" array in the jem file.
Each equation will start with a key for the model the animations will affect. This is done through use of a model variable in the format <model>.<variable>:
The main two model properties are:
part - part refers to the part that the custom model has been attached to or replaced, this will animate the existing part and the model that has replaced/added to the part.
this - this refers to the part that has been added, this will not affect the original part, this can be seen clearly if the new model has been attached instead of replacing.
The variable has 12 possible values and this will define the type of animation and the axis that will be affected.
The type can any one of 4 possible values:
rotation (r), offset (o), translation (t), scale (s)
Followed by one of the three axis (x, y, z)
Note the difference between translate and offset. Offset refers to an absolute value for the model whereas translate will refer to a relative value, which will be relative to the existing location of the part model.
eg "part.ty", "this.ox", "part.rz"
Following the model variable will be a string which contains a mathematical equation.
There's several variables and functions which can be used within equations.
variables:
model variables - Already stated, these can be used to get values from other parts on the entity.
time - This is the world time in ticks and can be used on all entities.
limb_swing, limb_speed - Can only be used with 'living' entities, the swing and speed of entity limbs, these will change when the entity is moving.
operators:
+ addition, - subtraction, / division, * multiplication, % modulo (gives the remainder after division)
functions:
sin(), cos(), tan(), abs(), round(), sqrt() and many more, listed in the optifine documentation.
Custom animations can be applied to existing parts of an entity, this is done by not specifying any models but setting "attach": true for the part and setting the animations.
This is a small problem which seemed impossible to acheive, the idea was to be able to change the origin for limbs as the point from where limbs were swinging couldn't be changed with translate. This would allow legs to be bigger or smaller, further apart or closer together than the original entity.
The way this can be done is using animations to simply translate the limb a fixed amount, and it will move the origin of the part itself.
I don't really need tutorial, already figured out most of the stuffs except moving the origin of a part, didn't know that it was possible! Huge thanks!
I created all this with notepad++
Rollback Post to RevisionRollBack
I don't speak English. Don't expect everyone to speak English. Seeing expressions and grammar errors? Not my problem. Deal with it.
Is it possible to tie custom entity models to optifines random mob feature? I dont want to replace every creeper in the game with a new model for example, i want to give various textures and have them spawn randomly.
Hello, I have been making a 3D resource pack for my new mini-game. One of the blocks that I have to modify is the Sign, it is an entity model so I had to investigate Custom Entity Models. Within the map, the signs are sometimes placed on Spruce Logs, which, in my 3D pack, extend outwards 2 pixels off of all sides (except for top and bottom). Now this extension prevents the Sign's text from being visible.
I have figured out how to make custom entity models, but what I need to know is how to actually move the text of the sign. Because when you modify the board part of the sign, the text stays floating where it originally was. Do you know how to shift the position of the text itself?
If not, I could always modify the log so that it doesn't stick out as far as it does...
Hello, I was just curious is there any step by step tutorial on how to do this? I'm extremely new to Minecraft entity modelling, I know the basic gist of how to model something in Blockbench, I've tried with my limited skills to reverse engineer one of those entity models, still no luck.
I was wondering, if we make custom mobs with optifine, could we use them in our minecraft server and have players play in a world with the models without having to download optifine itself or need to download anything for that matter?
why couldn't we? what would roadblock us from having a server with custom models and having it public. I am curious because I want to make a server and am just mapping everything out. I really want custom models.
why couldn't we? what would roadblock us from having a server with custom models and having it public. I am curious because I want to make a server and am just mapping everything out. I really want custom models.
Because rendering is done client side, not server side. This is why Optifine is strictly a client mod and doesn't run on servers. There's absolutely no point to speeding up rendering on a system that doesn't actually do any rendering.
So yes, you can totally have a server with loads of custom models... but the end users will need to install Optifine in order to actually SEE them.
I see... is there any way I could make a server with like, let's say I want a rat mob, could I potentially alter the endermite to look like a rat ie change it's textures or model so I could have a minecraft server with rats?
I see... is there any way I could make a server with like, let's say I want a rat mob, could I potentially alter the endermite to look like a rat ie change it's textures or model so I could have a minecraft server with rats?
I feel that I might not want to join in this conversation, but I guess I'll just answer your question here...
The best way to do it is to have a prompted resource pack connected to your server. It causes all players logging in to download it and apply it immediately. It can be a bit of a hassle for the players FYI. But they would still have to be using Optifine in order to see the models. Perhaps you could use a mechanism to ensure that they are using it: whether it'd be a command system that checks their client (if possible); or simply have a room with a sign (or wall) that only displays its text with said resource pack on with Optifine, and they would have to enter the text into something to be sent into the main server.
I feel that I might not want to join in this conversation, but I guess I'll just answer your question here...
The best way to do it is to have a prompted resource pack connected to your server. It causes all players logging in to download it and apply it immediately. It can be a bit of a hassle for the players FYI. But they would still have to be using Optifine in order to see the models. Perhaps you could use a mechanism to ensure that they are using it: whether it'd be a command system that checks their client (if possible); or simply have a room with a sign (or wall) that only displays its text with said resource pack on with Optifine, and they would have to enter the text into something to be sent into the main server.
I've been trying for days to change how the trident is shaped, I've seen images but can't find a single reliable source.
Is it even actually possible to change the trident's shape while it's in your hand?
Although I can change its position, no matter how I change the .json it's shape stays the same, I'm close to giving up.
If I recall correctly, the trident, while in your hand, is an item model, not an entity model. You might consider looking into this avenue. I have not personally modified the trident model, but items in your hands are still considered items.
I really wanted to know if it is possible to modify the modeling of an entity more than once, I wanted to create a texture where a zombie model with the name "a" had such a model and the zombie with the name "b" had another, and possible? I use version 1.12.2
A quick guide to help get started with entity modelling in optifine.
I hope to update this guide as time goes on, but currently this won't go too in depth with what you can do.
Intro
Optifine's entity modelling allows you to replace or add to different parts of an entity, ie head, body, arm1, arm2, leg1, leg2.
The parts that each entity has is different and the full list of parts can be found in optifine's jem documentation.
Optifine also has jpm documentation.
To help there is some existing entity modelling test resourcepacks which you can use to help see how the files can be made: my tests, sp614x's tests, sp614x's tests #2, and a remodeled creeper I made.
Working directory: all custom entity files will be placed into assets/minecraft/optifine/cem in your resourcepack.
jem Files:
A jem file is required when entity modelling, it is the main file which specifies how to re-model an entity.
You simply need to create a jem file named as the entity that you want to have a custom model, ie zombie.jem.
A full list of entities and the names of the files can be found in the optifine's jem documentation along with a list of parts which can be replaced in each entity.
jem stands for JSON Entity Model, meaning that the file must be written in valid JSON.
Firstly "models" is a required parameter which is an array, it will contain objects which then contain models and which parts they replace.
#part must be replaced with one of the parts specified in the optifine's jem documentation. ie "head", "body", "leg1".
#model can be replaced one of two things, you can use a jpm file, or you can specify the model in-line by creating the elements within the jem file itself.
You can replace #model with elements (explained further down), or with "model": "file_name.jpm".
There is some other values that will come in handy which are: "attach": < true | false >, "translate": [x, y, z], "rotate": [x, y, z].
"attach" will default to false if left out, but if set to true will add the model to the part specified rather than replacing it.
"translate" will move the element the number of pixels on the specified axes.
"rotate" will rotate the element on the axes the amount of degrees.
jpm Files:
jpm stands for JSON Part Model, which means that the file must be valid JSON. jpm files must be located within the optifine/cem folder.
A jpm file is purely a part which can consist of multiple elements which can then be used by jem files when replacing parts.
These files do not need to have specific names. But you need to create at least one element.
Instead of writing jpm files by hand, Cubik Studio (~ €20), a modelling program which supports Minecraft json block models, also has the ability to export jpms from the program itself.
You can also use blockbench a free block modelling program, which can be downloaded or used online, which can also export optifine jpms.
This means you won't have to write a jpm by hand but can just create and export models from Cubik Studio or blockbench.
Creating Elements:
"texture": "path/to/texture.png", "textureSize": ['width', 'height'], "boxes": [ { #texturing "coordinates": [0, 0, 0, 2, 2, 2] }, { #texturing "coordinates": [3, 4, 0, 2, 2, 2] } ]
This is a basic method of creating elements, note that "coordinates" works quite differently from that when block modelling. The first three values are the location of the element, the next three are actually the width, height and depth.
"coordinates": [0, 0, 0, 2, 2, 2]
"coordinates": [3, 4, 0, 2, 2, 2]
Both of these elements will be the same size but will be in different places.
Texturing Elements:
There is two ways to texture elements but first you need to specify the texture that will be used by the element by specifying the path following assets/minecraft ie, "texture": "textures/entity/pig/pig.png". You also need to put the size of the texture in pixels ie, "textureSize": [64, 32].
When texturing an element you can specify the uv mapping of individual faces with: "uvUp", "uvDown", "uvNorth", "uvEast", "uvSouth", "uvWest".
ie "uvUp": [0, 0, 4, 6]. The first two numbers are the most top left coordiante of the area you want to have the texture then the next two will be the opposite most right down corner.
The second method is to use "textureOffset" which works with a unwrapped box texture layed out in this specific format. You specify one set of coordinates which is the most top left coordinates of the rectangle drawn around the unwrapped box. From this example the coordinates would be [0, 0], ie "textureOffset": [0, 0].
Animations:
Custom animations can be applied to each part of the entity, they are created by mathematical equations located within the jem file for mobs. You can read the optifine documentation on animations for more information.
The animation equations used for custom animations are located within an object, within an array called "animations" which will be inside the object within the "models" array in the jem file.
Each equation will start with a key for the model the animations will affect. This is done through use of a model variable in the format <model>.<variable>:
The main two model properties are:
part - part refers to the part that the custom model has been attached to or replaced, this will animate the existing part and the model that has replaced/added to the part.
this - this refers to the part that has been added, this will not affect the original part, this can be seen clearly if the new model has been attached instead of replacing.
The variable has 12 possible values and this will define the type of animation and the axis that will be affected.
The type can any one of 4 possible values:
rotation (r), offset (o), translation (t), scale (s)
Followed by one of the three axis (x, y, z)
Note the difference between translate and offset. Offset refers to an absolute value for the model whereas translate will refer to a relative value, which will be relative to the existing location of the part model.
eg "part.ty", "this.ox", "part.rz"
Following the model variable will be a string which contains a mathematical equation.
There's several variables and functions which can be used within equations.
variables:
model variables - Already stated, these can be used to get values from other parts on the entity.
time - This is the world time in ticks and can be used on all entities.
limb_swing, limb_speed - Can only be used with 'living' entities, the swing and speed of entity limbs, these will change when the entity is moving.
operators:
+ addition, - subtraction, / division, * multiplication, % modulo (gives the remainder after division)
functions:
sin(), cos(), tan(), abs(), round(), sqrt() and many more, listed in the optifine documentation.
e.g.
"part.ty": "abs(2 * sin(time / 10)) + 12"
"part.tx": "abs(sin(time / 10))"
"part.rz": "0.2 * abs(sin(time/10))"
These animations are used on pigs in my model tests
Animating Existing Parts:
Custom animations can be applied to existing parts of an entity, this is done by not specifying any models but setting "attach": true for the part and setting the animations.
Moving the Origin of a Part
This is a small problem which seemed impossible to acheive, the idea was to be able to change the origin for limbs as the point from where limbs were swinging couldn't be changed with translate. This would allow legs to be bigger or smaller, further apart or closer together than the original entity.
The way this can be done is using animations to simply translate the limb a fixed amount, and it will move the origin of the part itself.
I do tutorials all about values encountered within block modelling on my website
I don't really need tutorial, already figured out most of the stuffs except moving the origin of a part, didn't know that it was possible! Huge thanks!
I created all this with notepad++
I don't speak English. Don't expect everyone to speak English. Seeing expressions and grammar errors? Not my problem. Deal with it.
Is it possible to tie custom entity models to optifines random mob feature? I dont want to replace every creeper in the game with a new model for example, i want to give various textures and have them spawn randomly.
No, this currently isn't possible, it might be in the future, but no idea when that might be.
I do tutorials all about values encountered within block modelling on my website
Hello, I have been making a 3D resource pack for my new mini-game. One of the blocks that I have to modify is the Sign, it is an entity model so I had to investigate Custom Entity Models. Within the map, the signs are sometimes placed on Spruce Logs, which, in my 3D pack, extend outwards 2 pixels off of all sides (except for top and bottom). Now this extension prevents the Sign's text from being visible.
I have figured out how to make custom entity models, but what I need to know is how to actually move the text of the sign. Because when you modify the board part of the sign, the text stays floating where it originally was. Do you know how to shift the position of the text itself?
If not, I could always modify the log so that it doesn't stick out as far as it does...
Hello, I was just curious is there any step by step tutorial on how to do this? I'm extremely new to Minecraft entity modelling, I know the basic gist of how to model something in Blockbench, I've tried with my limited skills to reverse engineer one of those entity models, still no luck.
I was wondering, if we make custom mobs with optifine, could we use them in our minecraft server and have players play in a world with the models without having to download optifine itself or need to download anything for that matter?
no you couldn't
why couldn't we? what would roadblock us from having a server with custom models and having it public. I am curious because I want to make a server and am just mapping everything out. I really want custom models.
Because rendering is done client side, not server side. This is why Optifine is strictly a client mod and doesn't run on servers. There's absolutely no point to speeding up rendering on a system that doesn't actually do any rendering.
So yes, you can totally have a server with loads of custom models... but the end users will need to install Optifine in order to actually SEE them.
I see... is there any way I could make a server with like, let's say I want a rat mob, could I potentially alter the endermite to look like a rat ie change it's textures or model so I could have a minecraft server with rats?
I feel that I might not want to join in this conversation, but I guess I'll just answer your question here...
The best way to do it is to have a prompted resource pack connected to your server. It causes all players logging in to download it and apply it immediately. It can be a bit of a hassle for the players FYI. But they would still have to be using Optifine in order to see the models. Perhaps you could use a mechanism to ensure that they are using it: whether it'd be a command system that checks their client (if possible); or simply have a room with a sign (or wall) that only displays its text with said resource pack on with Optifine, and they would have to enter the text into something to be sent into the main server.
Just some ideas. Might be good, might be awful.
Some helpful links:
Minecraft Forum - How to set a resource pack to a server
Resource pack - Official Minecraft Wiki
server.properties - Official Minecraft Wiki
Thank you so much!
how do i make for example a sheep huge? What would i need to do?
Alter the scale, and possibly adjust the limb speeds depending on how it looks with the entity's movement speed.
Is there any way to pre-generate java entities in blockbench so you can edit them with ease?
I've been trying for days to change how the trident is shaped, I've seen images but can't find a single reliable source.
Is it even actually possible to change the trident's shape while it's in your hand?
Although I can change its position, no matter how I change the .json it's shape stays the same, I'm close to giving up.
If I recall correctly, the trident, while in your hand, is an item model, not an entity model. You might consider looking into this avenue. I have not personally modified the trident model, but items in your hands are still considered items.
I really wanted to know if it is possible to modify the modeling of an entity more than once, I wanted to create a texture where a zombie model with the name "a" had such a model and the zombie with the name "b" had another, and possible? I use version 1.12.2
Blockbench no longer works, it saves me a jem without any information about my model