Guard Villagers

Guard Villagers

56M Downloads

No longer able to use completely different skins for guards

Th3Fanbus opened this issue ยท 3 comments

commented

Back in Minecraft 1.20.1 I made a resource pack that applied different Steve skins to each villager variant. But when trying to do the same thing in Minecraft 1.21.1 I found out that it's no longer possible: after updating my resource pack to work with the new guard variants system (commit ff15cd9), the per-variant textures only appear in a few places, over the default Steve texture (shared for all variants).

I looked at the source code, and got things to work for me by changing this function:

public ResourceLocation getTextureLocation(Guard entity) {
return guardTextures;
}

    public ResourceLocation getTextureLocation(Guard entity) {
        String guardSteve = GuardConfig.CLIENT.GuardSteve.get() ? "_steve" : "";
        ResourceLocation resourcelocation = ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "textures/entity/guard/guard" + guardSteve + "_" + entity.getVariant() + ".png");
        AbstractTexture abstracttexture = Minecraft.getInstance().getTextureManager().getTexture(resourcelocation);
        if (abstracttexture == MissingTextureAtlasSprite.getTexture())
            return ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "textures/entity/guard/guard" + guardSteve + ".png");
        else
            return resourcelocation;
    }

I know, this isn't great, there's most likely a cleaner approach, but at least that got me going for now. Still, it would be nice if resourcepacks could provide per-variant textures for all model layers, instead of having to share the same texture.

commented

Back in Minecraft 1.20.1 I made a resource pack that applied different Steve skins to each villager variant. But when trying to do the same thing in Minecraft 1.21.1 I found out that it's no longer possible
Still, it would be nice if resourcepacks could provide per-variant textures for all model layers, instead of having to share the same texture.

This is actually still possible. I made an example pack that demonstrates how to add per variant textures that can change even the "skin" layer. The base overlay textures themselves are just the original texture with the clothing elements only, with the parts where the "skin" is located intentionally left transparent.

test.zip

Image

commented

currently using latest verion on 1.20.1 and still unable to use custom skins. i have tried using the test zip and still nothing. i am also trying to use the human village guards resouce pack.

commented

currently using latest verion on 1.20.1 and still unable to use custom skins. i have tried using the test zip and still nothing. i am also trying to use the human village guards resouce pack.

Please make a separate issue for this as this seems to be a completely unrelated problem.