Jump to content

setTextureName method not working


Recommended Posts

I am trying to make my first item, but for some reason the setTextureName method gives me an error that says "The method setTextureName(String) is undefined for the type ItemKey". But, when I do certain things to the code such as change "MODID" in the setTextureName method to "modid", the error for setTextureName disappears and I instead get an error for modid, (which makes sense). Also, if I remove the quotation marks from the colon in the setTextureName method, the error on setTextureName once again goes away, but I get errors on the colon, + sign, and "key". Since I am relatively new to modding I might be missing something obvious.


package com.arti.artismod;


import net.minecraft.item.Item;

import net.minecraft.creativetab.CreativeTabs;


public class ItemKey extends Item {

    private String name = "key";

    public ItemKey() {

        setUnlocalizedName(ArtisMod.MODID + "_" + "key");

        setTextureName(ArtisMod.MODID + ":" + "key");




Link to comment
Share on other sites

I found this webpage and made the changes that were suggested, and I don't get any errors, but when I try to enter my minecraft world I get this error, "Forge Mod Loader detected missing blocks/items. There are 1 missing blocks and items in this save. If you continue the missing blocks/items will get removed. A world backup will be automatically created in your saves directory. Missing Blocks/Items: arti_artismod:Key"


The webpage:


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.

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.