How do I get an ItemStack of item? Specifically an Emerald? Sorry for the noob questions, would be extremely helpful to be pointed in the right direction. I know about the getItemStack() method but I can't seem to find the proper way to use it. This is how I'm using it for: Code: public void onBlockBreak(BlockBreakEvent event) { final Block origin = event.getBlock(); final int type = origin.getTypeId(); if (type == 31) { event.getPlayer().getWorld().dropItem(ItemStackHere); // how do I get the ItemStack of an Emerald? // getItemStack() ??? } } I'm stuck and any help is appreciated.
Here you go, enjoy: Code: @EventHandler public void onBlockBreak(BlockBreakEvent event) { final Block origin = event.getBlock(); final int type = origin.getTypeId(); if (type == 31) { event.getPlayer().getWorld().dropItem(new ItemStack(Material.EMERALD, 1)); } }