Posted January 13, 20178 yr @Override public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { ItemStack DenseIronSword = new ItemStack(SwordModMain.DenseIronSword); DenseIronSword.addEnchantment(Enchantment.sharpness, 3); worldObj.spawnEntityInWorld(DenseIronSword) return null; }
January 13, 20178 yr You can't convert an ItemStack to an Entity as they're completely separate types. You can create an EntityItem from an ItemStack , but that's not what you should be doing here. Block#getItemDropped is meant to return the Item dropped by the Block , not spawn an EntityItem in the world. If you need to drop an ItemStack with NBT (e.g. enchantments) or drop multiple types of item, override Block#getDrops to return a List<ItemStack> containing the ItemStack s you want to drop. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
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.