#how can i make a name dependent texture for a mob?

1 messages · Page 1 of 1 (latest)

cursive briar
#

i would like to do this for the ghast. i already have the texture made but dont know how to execute it

fallen grove
#

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.

cursive briar
#

awesome thank you!

cursive briar
fallen grove
cursive briar
#

like where in the texture pack i have the variant texture located?

fallen grove
#

Make sure the path is in the entity file as so:
"textures": {
"default": "textures/entity/rabbit/black",
"toast": "textures/entity/rabbit/toast"
},

cursive briar
#

and i put that in the render controller file too, correct?

fallen grove
cursive briar
#

awesome, thank you!

#

sorry for all the questions, im still new to this

fallen grove
#

No worries, glad to help ദി

cursive briar
#

{
"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]" ]
}
}
}

cursive briar
fallen grove
#

{
"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]" ]
}
}
}

cursive briar
#

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?

fallen grove
#

Sure thing

cursive briar
#

{
"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]" ]
}
}
}

cursive briar
fallen grove
# cursive briar { "format_version": "1.8.0", "render_controllers": { "controller...

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]))))))))))" ]
}
}
}

cursive briar
#

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?

fallen grove
strange raven
#

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

fallen grove
cursive briar
fallen grove
cursive briar
#

{
"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?

fallen grove
#

You would do:
"query.get_name == 'King' ?Texture.King :(query.is_shooting && query.get_name == 'King' ? Texture.king_shooting : (Array.skins[variable.ischarging]))"

cursive briar
#

{
"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]))" ]
}
}
}

cursive briar
#

so now that i've plugged it into the game and tested it, the ghast doesn't change texture now when i name it

fallen grove
#

Did you add king and king shooting to the entry file paths?

cursive briar
#

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"

fallen grove
#

Don’t capitalise

#

Don’t add spaces

cursive briar
#

gotcha

fallen grove
fallen grove
#

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

cursive briar
# fallen grove No no

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"
}
}
}
}

fallen grove
cursive briar
#

so whenever i name the mob the specific name i put in the render controller, the phantom just goes invisible

fallen grove
#

Did you edit the geo?

#

Or have other packs installed?

cursive briar
#

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

fallen grove
#

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))))"

cursive briar
#

im going to test it now

#

so unfortunately the texture didnt work and the phantom still became invisible

fallen grove
#

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?

cursive briar
#

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

fallen grove
#

It would be purple/black though not invisible

cursive briar
#

ohh okay, gotcha

#

i did create these textures using blockbench but none of my other custom textures have done this

fallen grove
#

Mind sending me the pack

cursive briar
#

the entire pack or just the textures?

fallen grove
#

The entire phantom pack

cursive briar
#

gotcha

fallen grove
#

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.

cursive briar
#

ohhhh okay, gotcha