#how can i make a name dependent texture for a mob?
1 messages · Page 1 of 1 (latest)
As in nametaging the mob and the texture changes?
If so, in the render controller’s textures add this:
[ "query.get_name == 'Toast' ? Texture.toast : Texture.default" ]
Obvi change toast to whatever the name you want to name tag the mob.
awesome thank you!
is this the only thing i need to do regarding the texture?
You need to add the texture file path into the entity file if you haven’t done so
like where in the texture pack i have the variant texture located?
Make sure the path is in the entity file as so:
"textures": {
"default": "textures/entity/rabbit/black",
"toast": "textures/entity/rabbit/toast"
},
and i put that in the render controller file too, correct?
Put this in render controllers, yes then it should work ദി
No worries, glad to help ദി
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.ghast": {
"arrays": {
"textures": {
"Array.skins": [ "Texture.default", "Texture.shooting" ]
}
},
"geometry": "Geometry.default",
"materials": [ { "*": "Material.default" } ],
"textures": [ "Array.skins[variable.ischarging]" ]
}
}
}
so this is currently what my ghast render controller looks like. would i put that into the textures section? also, since the ghast changes textures when shooting fireballs will this affect that at all?
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.ghast": {
"arrays": {
"textures": {
"Array.skins": [ "Texture.default", "Texture.shooting" ]
}
},
"geometry": "Geometry.default",
"materials": [ { "*": "Material.default" } ],
"textures": [ "query.get_name == 'Toast' ? Texture.toast : Array.skins[variable.ischarging]" ]
}
}
}
awesome thank you so much! it worked
i tried doing it for a different mob, i followed the exact same steps but for some reason the mob turns invisible when i name it. do you mind taking a look at it for me?
Sure thing
{
"format_version": "1.8.0",
"minecraft:client_entity": {
"description": {
"identifier": "minecraft:frog",
"materials": {
"default": "frog"
},
"textures": {
"temperate": "textures/entity/frog/temperate_frog",
"cold": "textures/entity/frog/cold_frog",
"warm": "textures/entity/frog/warm_frog",
"Black": "textures/entity/frog/blackfrog",
"Orange": "textures/entity/frog/orangefrog",
"Purple": "textures/entity/frog/purplefrog",
"Light Blue": "textures/entity/frog/cyanfrog",
"Red": "textures/entity/frog/redfrog",
"Green": "textures/entity/frog/greenfrog",
"White": "textures/entity/frog/whitefrog",
"Balloon": "texture/entity/frog/balloonfrog",
"Bubble": "textures/entity/frog/bubblefrog",
"Glowing": "textures/entity/frog/glowingfrog"
},
"geometry": {
"default": "geometry.frog"
},
"spawn_egg": {
"texture": "spawn_egg_frog"
},
"scripts": {
"pre_animation": [
"variable.moving = query.ground_speed > 0 || query.vertical_speed > 0;"
]
},
"animations": {
"croak": "animation.frog.croak",
"jump": "animation.frog.jump",
"tongue": "animation.frog.tongue",
"walk": "animation.frog.walk",
"swim": "animation.frog.swim",
"idle_water": "animation.frog.idle.water",
"look_at_target": "animation.common.look_at_target"
},
"animation_controllers": [
{ "general": "controller.animation.frog.general" },
{ "croaking": "controller.animation.frog.croaking" },
{ "eat_mob": "controller.animation.frog.eat_mob" }
],
"render_controllers": [
"controller.render.frog"
]
}
}
}
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.frog": {
"arrays": {
"textures": {
"Array.skins": [ "Texture.temperate", "Texture.cold", "Texture.warm"]
}
},
"geometry": "Geometry.default",
"part_visibility": [ { "croaking_body": "!query.is_eating_mob" } ],
"materials": [ { "*": "Material.default" } ],
"textures": [ "query.get_name == 'Balloon' ? Texture.balloonfrog : query.get_name == 'Bubble' ? Texture.bubblefrog : query.get_name == 'Glowing' ? Texture.glowingfrog : query.get_name == 'Red' ? Texture.redfrog : query.get_name == 'Light Blue' ? Texture.cyanfrog : query.get_name == 'Black' ? Texture.blackfrog : query.get_name == 'Green' ? Texture.greenfrog : query.get_name == 'Orange' ? Texture.orangefrog : query.get_name == 'Purple' ? Texture.purplefrog : query.get_name == 'White' ? Texture.whitefrog : Array.skins[query.variant]" ]
}
}
}
so this one is for the frog entity, i have all the textures in the correct entity file
When adding multiples you have to add parenthesis:
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.frog": {
"arrays": {
"textures": {
"Array.skins": [ "Texture.temperate", "Texture.cold", "Texture.warm"]
}
},
"geometry": "Geometry.default",
"part_visibility": [ { "croaking_body": "!query.is_eating_mob" } ],
"materials": [ { "*": "Material.default" } ],
"textures": [ "query.get_name == 'Balloon' ? Texture.balloonfrog : (query.get_name == 'Bubble' ? Texture.bubblefrog : (query.get_name == 'Glowing' ? Texture.glowingfrog : (query.get_name == 'Red' ? Texture.redfrog : (query.get_name == 'Light Blue' ? Texture.cyanfrog : (query.get_name == 'Black' ? Texture.blackfrog : (query.get_name == 'Green' ? Texture.greenfrog : (query.get_name == 'Orange' ? Texture.orangefrog : (query.get_name == 'Purple' ? Texture.purplefrog : (query.get_name == 'White' ? Texture.whitefrog : (Array.skins[query.variant]))))))))))" ]
}
}
}
ohh that explains a lot, thank you!
i did have one more question about the first mob i did. the first mob i did was the ghast. is there any way that with the new variant i put, to have a shooting texture like the original ghast?
Don’t know the ghast render controllers by heart, is there a shooting query within it?
Don't use quey.get_name, use query.is_name_any('Name1','name2','NaMe3'), it's more efficient and allows you to have mutliple names leading to one model/texture
Only if they want per say: balloonfrog to have multiple names
doesnt look like it was a "query_is_shooting" but it does have a "variable_ischarging"
You would do:
(query_is_shooting && query.get_name == 'Purple' ? Texture.purple
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.ghast": {
"arrays": {
"textures": {
"Array.skins": [ "Texture.default", "Texture.shooting" ]
}
},
"geometry": "Geometry.default",
"materials": [ { "*": "Material.default" } ],
"textures": [ "query.get_name == 'King' ? Texture.king : Array.skins[variable.ischarging]" ]
}
}
}
so would i enter that after the query.get_name that i already put?
You would do:
"query.get_name == 'King' ?Texture.King :(query.is_shooting && query.get_name == 'King' ? Texture.king_shooting : (Array.skins[variable.ischarging]))"
so it should look like this correct?
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.ghast": {
"arrays": {
"textures": {
"Array.skins": [ "Texture.default", "Texture.shooting" ]
}
},
"geometry": "Geometry.default",
"materials": [ { "*": "Material.default" } ],
"textures": [ "query.get_name == 'King' ? Texture.king : (query.is_shooting && query.get_name == 'King' ? Texture.kingshoot : (Array.skins[variable.ischarging]))" ]
}
}
}
Looks good
so now that i've plugged it into the game and tested it, the ghast doesn't change texture now when i name it
Did you add king and king shooting to the entry file paths?
yes, so this is what my entity file textures say
"textures": {
"default": "textures/entity/ghast/ghast",
"shooting": "textures/entity/ghast/ghast_shooting",
"King": "textures/entity/ghast/king",
"King shooting": "textures/entity/ghast/kingshoot"
gotcha
Sure thing. Seems like it’s this issue. @analog chasm
Looks good. But the Texture.happy_ghast has to match the texture names you put in the entity file
So it would be Texture.jade
And so on
No no
In your entity file
Um so I change it to this,
And it still doesn't work
"format_version": "1.10.0",
"render_controllers": {
"controller.render.happy_ghast": {
"geometry": "Geometry.default",
"materials": [
{
"*": "Material.default"
}
],
"textures": [
"query.get_name == 'Jade' ? Texture.jade : (query.get_name == 'Buck' ? Texture.buck : (query.get_name == 'Kevin' ? Texture.kevin : (query.get_name =='Lewis' ? Texture.lewis : (query.get_name == 'Rex' ? Texture.rex : (query.get_name == 'Anne' ? Texture.anne : (query.get_name == 'Kelly' ? Texture.kelly : (query.is_baby ? Texture.ghastling : (Texture.happy_ghast))))))))"
],
"part_visibility": [
{
"*": "!query.is_invisible"
}
]
},
"controller.render.happy_ghast_ropes": {
"geometry": "Geometry.ropes",
"materials": [
{
"*": "Material.default"
}
],
"textures": [
"Texture.ropes"
],
"part_visibility": [
{
"*": "variable.render_ropes"
}
]
}
}
}```
This is how it should be set up
hey man i dont mean to bother you again, but im having some trouble trying to make name dependant textures for the phantom and i was wondering if you could help?
this is my render controller
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.phantom": {
"arrays": {
"materials": {
"Array.materials": [ "Material.default", "Material.invisible" ]
}
},
"geometry": "Geometry.default",
"materials": [ { "*": "Array.materials[query.is_invisible]" } ],
"textures": [ "query.get_name == 'Shy' ? Texture.shy : (query.get_name == 'Tanooki' ? Texture.tanooki : (query.get_name == 'Pink' ? Texture.pink : (query.get_name =='Gold' ? Texture.gold : (query.get_name == 'BombBoo' ? Texture.bombboo : Texture.default))))" ]
}
}
}
and this is my entity file
{
"format_version": "1.10.0",
"minecraft:client_entity": {
"description": {
"identifier": "minecraft:phantom",
"materials": {
"default": "phantom",
"invisible": "phantom_invisible"
},
"textures": {
"default": "textures/entity/phantom",
"pink": "textures/entity/phantom/pink",
"tanooki": "textures/entity/phantom/tanooki",
"bombboo": "textures/entity/phantom/bombboo",
"gold": "textures/entity/phantom/gold",
"shy": "textures/entity/phantom/shy"
},
"geometry": {
"default": "geometry.phantom"
},
"scripts": {
"pre_animation": [
"variable.wingRotZ = 16.0 * Math.sin((variable.RuntimeID * 3 + query.life_time * 20.0) * 7.448454);",
"variable.tailRotX = -5.0 * Math.sin((variable.RuntimeID * 3 + query.life_time * 20.0) * 14.896908) - 5.0;"
],
"initialize": [
"variable.runtimeid = 0;",
"variable.tailrotx = -5.0;",
"variable.wingrotz = 0.0;"
],
"animate": [
"phantom_base_pose_controller",
"move"
],
"should_update_effects_offscreen": "1.0"
},
"animations": {
"phantom_base_pose": "animation.phantom.base_pose",
"move": "animation.phantom.move",
"phantom_base_pose_controller": "controller.animation.phantom.base_pose"
},
"animation_controllers": [
{
"phantom_base_pose": "controller.animation.phantom.base_pose"
},
{
"move": "controller.animation.phantom.move"
}
],
"particle_effects": {
"wing_dust": "minecraft:phantom_trail_particle"
},
"render_controllers": [
"controller.render.phantom"
],
"spawn_egg": {
"texture": "spawn_egg_phantom"
}
}
}
}
Seems fine to me. What error are you getting?
so whenever i name the mob the specific name i put in the render controller, the phantom just goes invisible
i did edit the geo, but i do not have any conflicting packs enabled besides the one i am xurrently messing with. while i did change the geo, its still labeled as the default phantom geo
Normally you wouldn’t have to do this, but try adding the same queries to the geometry.
"geometry": "query.get_name == 'Shy' ? Geometry.default : (query.get_name == 'Tanooki' ? Geometry.default : (query.get_name == 'Pink' ? Geometry.default : (query.get_name =='Gold' ? Geometry.default : (query.get_name == 'BombBoo' ? Geometry.default : Geometry.default))))"
im going to test it now
so unfortunately the texture didnt work and the phantom still became invisible
Hm, add an extra parenthesis to the original version.
"textures": [ "query.get_name == 'Shy' ? Texture.shy : (query.get_name == 'Tanooki' ? Texture.tanooki : (query.get_name == 'Pink' ? Texture.pink : (query.get_name =='Gold' ? Texture.gold : (query.get_name == 'BombBoo' ? Texture.bombboo : (Texture.default)))))" ]
If that still doesn’t work. I’m a bit stumped because it should be working.
Are you sure your textures are done correctly?
i believe so, because the phantom does not have a designated texture folder, i ended up created one but i believe i put the correct file location in the entity folder
It would be purple/black though not invisible
ohh okay, gotcha
i did create these textures using blockbench but none of my other custom textures have done this
Mind sending me the pack
the entire pack or just the textures?
The entire phantom pack
gotcha
Got it to work.
The only change I did was add an ❝ s ❞ to the end of the render controllers so I could test if the render controller was working. Afterwards I just removed the animation controllers of the entity file.
1.10.0 entities no longer user animation controllers
You add the controllers under the animate component within scripts
1.8.0 entities can use animation controllers but not animate scripts
Something to keep in mind.
ohhhh okay, gotcha