Posted May 21, 201510 yr I am having trouble spawning lightning bolts. There is thunder, but I cant seem to see the lightning bolt. Any solutions? I am new btw.
May 21, 201510 yr Author package mod; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumFacing; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.minecraft.util.Vec3; import net.minecraft.world.World; public class ZeusLightningBolt extends Item { public ZeusLightningBolt(ToolMaterial material) { super(); } public ItemStack onItemRightClick(ItemStack Itemstack, World world, EntityPlayer Entityplayer) { if(Entityplayer.capabilities.isCreativeMode || Entityplayer.inventory.consumeInventoryItem(Items.redstone)) world.playSoundAtEntity(Entityplayer, "ambient.weather.thunder", 20.0F, 40.0F / (itemRand.nextFloat() * 20.0F + 40.0F)); world.playSoundAtEntity(Entityplayer, "random.explode", 20.0F, 40.0F / (itemRand.nextFloat() * 20.0F + 40.0F)); double x = 0; double y = 0; double z = 0; world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z)); return Itemstack; } }
May 22, 201510 yr 1. use code tags 2. so. you are triing to spawn a lightning at the position 0,0,0 .. what are you expecting
May 22, 201510 yr This link might help http://www.minecraftforge.net/forum/index.php/topic,26772.msg136666.html#msg136666 DaBooty has good advice too -TGG
May 22, 201510 yr Author it keeps telling me to set posX as a variable. I cant seem to get around that.
May 22, 201510 yr it keeps telling me to set posX as a variable. I cant seem to get around that. Learn Java and how minecraft works. Please. The lightning has to be somewhere so the coordinates are necessary. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
May 22, 201510 yr 1. use code tags 2. so. you are triing to spawn a lightning at the position 0,0,0 .. what are you expecting Also, minecraft 1.8 uses World#addWeatherEffect not World#spawnEntityInWorld to spawn a lightning bolt. CommandSummon gives an example of how to summon lightnings. Author of Tao Land Mod. http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img] Also, author of RenderTo ---- I'm not an English native speaker. I just try my best.
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.