Posted June 6, 201213 yr Hi, I started yesterday in forge coding and I need to do one thing, but don't know how.. I have an item class which has an overrided method, RightClick. The problem is that I can't make it individual for each Item created. Bit confusing, isn't it? Let me throw an example: Player crafted an Item. Player crafted the same Item again. When he right clicks one (no matter which) of the items, the action executes for both. Can someone help me? It is the only missing thing preventing me to finish the mod.
June 6, 201213 yr Yes, thats how minecraft items work, there are only ever one instance of the class. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
June 6, 201213 yr Author Thanks for the fast answer, but the problem is that isn't working. The variables isn't statics and dunno what to do. As I wrote in the example, the same issue occurs in the code.
June 6, 201213 yr And Im saying that the item itself is only ever created ONCE. Every time that someone crafts the item they get a unique ItemStack not a unique Item. Look into the ItemStack, if you want to have two of the same items different. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
June 6, 201213 yr Author Sorry, I had read your text too fast and understood it wrong. (plus the fact i don't speak well english) Well, is there a way to make it different for undefined number of items? Like the IC2 nano saber, which I can turn one whithout turning another. (don't get well the ItemStack thing. I just use it for meta items and returns)
June 9, 201213 yr Sorry, I had read your text too fast and understood it wrong. (plus the fact i don't speak well english) Well, is there a way to make it different for undefined number of items? Like the IC2 nano saber, which I can turn one whithout turning another. (don't get well the ItemStack thing. I just use it for meta items and returns) If you need to store data for individual items then store it in the ItemStack metadata/damage if it will fit a short, else save it in the ItemStack NBT data. That is the only way.
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.