I made a block that spawns in items that will rain down from the sky. It works fine except for every time it spawns in an item, it spawns a second item that cannot be picked up. I have tried a few different things but I can't seem to figure it out.
spawnPos = this.getPos().north(offsetX).west(offsetZ).up(32);
worldObj.spawnEntityInWorld(new EntityItem(worldObj, spawnPos.getX(), spawnPos.getY(), spawnPos.getZ(), new ItemStack(CosmosisItems.cosmic_shard, 1)));
Wrap your code in this:
that will make sure that it doesn't spawn ghost items that only appear to the client.
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!
Thank you, that fixed the issue.