Jump to content

[1.7.2] How to change player skin?


Recommended Posts

Hi! Hwo to change player skin in modification? I tried to change RenderPlayer using RenderRegistry, but i recevie this error:

Failed to load texture java.io.FileNotFoundException

I know i have to download this skin to mine disc but it doesn't work:

    public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str)
        return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), texture, new ImageBufferDownload());

    /*public static ThreadDownloadImageData getDownloadImageCape(ResourceLocation par0ResourceLocation, String par1Str)
        return getDownloadImage(par0ResourceLocation, getCapeUrl(par1Str), (ResourceLocation)null, (IImageBuffer)null);

    private static ThreadDownloadImageData getDownloadImage(ResourceLocation par0ResourceLocation, String par1Str, ResourceLocation par2ResourceLocation, IImageBuffer par3IImageBuffer)
        TextureManager var4 = Minecraft.getMinecraft().getTextureManager();
        Object var5 = var4.getTexture(par0ResourceLocation);

        if (var5 == null)
            var5 = new ThreadDownloadImageData(par1Str, par2ResourceLocation, par3IImageBuffer);
            var4.loadTexture(par0ResourceLocation, (ITextureObject)var5);

        return (ThreadDownloadImageData)var5;

Thanks for help:)

Link to comment
Share on other sites

IS this code good?:

protected ResourceLocation getEntityTexture(AbstractClientPlayer par1AbstractClientPlayer) {
        String var1 = par1AbstractClientPlayer.getCommandSenderName();

        if (!var1.isEmpty())
            this.locationSkin = getLocationSkin(var1);
            //this.locationCape = getLocationCape(var1);
            this.downloadImageSkin = getDownloadImageSkin(this.locationSkin, var1);
            //this.downloadImageCape = getDownloadImageCape(this.locationCape, var1);
	return HPsRPAbstractClientPlayer.getSkinHP();
		Method method = AbstractClientPlayer.class.getDeclaredMethod("getSkinUrl", String.class);
		method.invoke(null, "http://dl.dropboxusercontent.com/link");
		return par1AbstractClientPlayer.getLocationSkin();
	catch (Exception e)
	return null;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.