Jump to content

setTextureName method not working


King_Arthur_III

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

        setCreativeTab(CreativeTabs.tabMisc);

    }

}

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:

http://www.wuppy29.com/minecraft/1-8-tutorial/updating-1-7-to-1-8-part-2-basic-items/#sthash.jYdavYL4.dpbs

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.

Guest
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.

Announcements



×
×
  • Create New...

Important Information

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