-
Notifications
You must be signed in to change notification settings - Fork 10
Entity Model Modifiers
This page explains how to use and configure entity models using entity model modifiers.
Caution
Custom entity models are still a work-in-progress feature and will likely break in the future. The current implementation is primarily to get feedback, thus any feedback would be appreciated 🙂
Entity model modifiers use json files located at assets/<namespace>/fusion/model_modifiers/entities. The names of the files are not significant.
An entity model modifier targets entities defined in a targets array.
Entities consist of multiple model layers and each layer consists of a model and a texture. Entity model modifiers allow adding new layers or modifying existing layers.
The layers key inside an entity model modifier should contain an object where each key is the identifier of a layer and the corresponding value contains properties for that layer.
Here is an example of an entity model modifier targeting a creeper and modifying the existing minecraft:creeper/main layer and adding a new minecraft:creeper/new_layer layer.
{
"targets": ["creeper"],
"layers": {
"main": {
...
},
"new_layer": {
...
}
}
}Each model layer has properties for the model and texture to be used, properties to translate, flip, and scale the model, and properties for conditional models and textures. The following model properties are available:
-
model: A model location or an array of model locations and objects containing model properties -
texture: A texture location or an array of texture locations -
flip_x: Boolean value to flip the model on the x-axis -
flip_y: Boolean value to flip the model on the y-axis -
flip_z: Boolean value to flip the model on the z-axis -
offset_x: Translates the model by the given value on the x-axis -
offset_y: Translates the model by the given value on the y-axis -
offset_z: Translates the model by the given value on the z-axis -
scale: Scales the model by the given factor
Here is an example which makes each creeper either have its regular model with a blue or red texture, or have a large model with an orange or purple texture.
{
"targets": ["creeper"],
"layers": {
"main": {
"model": [
"creeper/main",
{
"model": "large_creeper",
"texture": [
"entity/orange_creeper",
"entity/purple_creeper"
],
"scale": 1.1,
"offset_y": 0.2
}
],
"texture": [
"entity/blue_creeper",
"entity/red_creeper"
],
"scale": 0.9
}
}
}In addition to the properties already mentioned, model layers can also have conditional model properties dependent on entity predicates.
These conditional properties are located under the conditionals array. The array should contain objects with model properties and a conditions array.
The first entry in conditionals for which all conditions are met will be applied.
Here is an example of a model modifier which each creeper large and red when in the nether, blue when in the end, and yellow otherwise.
{
"targets": ["creeper"],
"layers": {
"main": {
"texture": "entity/yellow_creeper",
"conditionals": [
{
"texture": "entity/red_creeper",
"scale": 1.5,
"conditions": [
{
"type": "dimension",
"dimension": "nether"
}
]
},
{
"texture": "entity/blue_creeper",
"conditions": [
{
"type": "dimension",
"dimension": "the_end"
}
]
}
]
}
}
}The following 7 entity predicates are available:
-
altitude: holds if the entity is between the given minimum and maximum y-values in altitude-
min_height: the minimum altitude -
max_height: the maximum altitude
-
-
biome: holds if the entity is in one of the specified biomes-
biomes: an array of valid biomes
-
-
dimension: holds if the entity is in the specified dimension-
dimension: the dimension the entity should be in
-
-
is_baby: holds if the given entity is a baby -
and: holds if all given predicates are satisfied-
predicates: predicates which all need to be satisfied
-
-
or: holds if at least one of the given predicates is satisfied-
predicates: predicates of which one needs to be satisfied
-
-
not: holds only if the given predicate is not satisfied-
predicate: predicate of which the inverse will be taken
-