June 11, 201411 yr if u know java well this is the only help i can help u ex. metadata public class ItemX extends Item public int m; public ItemX(int metaData) super(); m = metaData; setUnlocalizedName("texturename" + m);
June 11, 201411 yr Items do not have metadata - the getMetadata(int param) is passed the ItemStacks.itemDamage value and the method converts it to the "metadata" desired. So, this call is not for actual metadata, it is to filter out the useless part of the ItemStack's damage value. Normally useful more for ItemBlocks. -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
June 11, 201411 yr Author I got it working , i got some ideas from Heltrato about ints and its awesome what i did is my localized name andtexture are gone to this String[] texture = {"blue","yellow"}; and i use ints to connect
June 11, 201411 yr Just so you understand the bug you are creating... the Item class creates any number of items (all completely different even if given the same name) and each Item (instancde) created is only a prototype of all such items. Therefore, any fields created in the Item class are shared with every item in the game. That includes yours and every other player who has on in their inventory. So, if you create an ItemX (and assign any 'metadata' to that object) then every itemX in the game will have the same metadata. In other words, every player and every ItemX-based item anywhere in the world will be changed when you change yours. Even the ones in players inventories and chests. I don't think that is what you want. -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
June 11, 201411 yr Author I dont get how come if a player remove an item like this with metadata removes the same as others. I mean i only use a custom item which is useless for my practice and i use only int so they will become unique i have blue ingot , yellow ingot <-- wth wrong?
June 11, 201411 yr I dont get how come if a player remove an item like this with metadata removes the same as others. I mean i only use a custom item which is useless for my practice and i use only int so they will become unique i have blue ingot , yellow ingot <-- wth wrong? The proper way to do what you seem to want (see ItemDye class) is to assign subtypes via Item#hasSubtypes and getIconFromDamage() as well as getSubItems(). The itemStack contains the damage value from which the subItem is determined, not some added field that has no meaning to minecraft. -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
June 11, 201411 yr I told u man if u know java well u can use that but that doesnt mean u only wrote that code yes i do that but i also got some other methods like what the upper guy says. It needs a meaning to minecraft in short
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.