Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

I got it working :D , 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

Posted

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.

Posted

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?

Posted

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.

Posted

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.

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.