Jump to content

jackdog336

Members
  • Posts

    1
  • Joined

  • Last visited

jackdog336's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. So I'm new to modding (Minecraft), and I am having trouble figuring out how to spawn a lightning bolt at a specific location (My block's xyz). The lightning spawns, just not on the block. One thing to note is the lightning is only to spawn when the block is broken by the player. Here's the code for the block: public class LightningOre extends BlockBase { public LightningOre(String name, Material material) { super(name, material); setSoundType(SoundType.STONE); setHardness(3.0F); setResistance(15F); setHarvestLevel("pickaxe", 3); setLightLevel(20F); } @Override public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) { EntityLightningBolt lightning = new EntityLightningBolt(worldIn, blockHardness, blockHardness, blockHardness, enableStats); worldIn.spawnEntity(lightning); } } Thanks in advance!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.