Posted December 14, 20168 yr Hey there, So I have 4 types of 'gems', in the inventory, they cannot be stacked, however, when they are picked up or /give they look like the respective crystal, but they ended up stacking in the inventory. My explanation might be dull, so here are some captioned pictures of whats happening: In the inventory, the different gems cannot be stacked. | v However, when I pick up a clearly non-stackable crystal, it stacks into it. Here is item class code: public class ItemMagicGems extends ItemBase { public static final Gems[] ALL_GEMS = Gems.values(); public Gems type; private final boolean isEmpowered; public ItemMagicGems(String name, boolean isEmpowered) { super(name); this.setFull3D(); this.isEmpowered = isEmpowered; } @Override public String getUnlocalizedName(ItemStack stack){ return stack.getItemDamage() >= ALL_GEMS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+"_"+ALL_GEMS[stack.getItemDamage()].name; } @Override public boolean hasEffect(ItemStack stack){ return this.isEmpowered; } @Override public EnumRarity getRarity(ItemStack stack){ return stack.getItemDamage() >= ALL_GEMS.length ? EnumRarity.COMMON : ALL_GEMS[stack.getItemDamage()].rarity; } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, NonNullList list){ for(int j = 0; j < ALL_GEMS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override protected void registerRendering(){ for(int i = 0; i < ALL_GEMS.length; i++){ String name = this.getRegistryName()+"_"+ALL_GEMS[i].name; PlentifulMisc.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(name), "inventory"); } } } , here is how I'm registering them: item_gems = new ItemMagicGems("item_gem", false); Thanks Relatively new to modding. Currently developing: https://github.com/LambdaXV/DynamicGenerators
December 14, 20168 yr Call setHasSubtypes(true); from your Item constructor. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
December 14, 20168 yr Author Yep, that seemed to fix it. Feel pretty dumb to forget that, Thanks! Relatively new to modding. Currently developing: https://github.com/LambdaXV/DynamicGenerators
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.