Posted May 30, 201411 yr Guys i just updated one of my Mob AI's from 1.6.4 but in 1.6.4 the lightning that my mob spawn renders ( as in it shows the lightning bolt) in 1.7.2 it doesnt show anything i mean it just shows the fire on the targeted entity. Here's my updateTasks on my one of Entity AI's public void updateTask(){ if(e.getAnimTick() == 30){ List list = e.worldObj.getEntitiesWithinAABBExcludingEntity(e, e.boundingBox.expand(12.0D, 8.0D, 12.0D)); for (int i = 0; i < list.size(); i++) { Entity entity = (Entity)list.get(i); if (e.getDistanceSqToEntity(entity) <= 100.0D) { double x = entity.posX - e.posX; double z = entity.posZ - e.posZ; double d = Math.sqrt(x * x + z * z); EntityLightningBolt l = new EntityLightningBolt(e.worldObj, entity.posX - 0.2D, entity.posY, entity.posZ - 0.2D); e.worldObj.addWeatherEffect(l); entity.motionX = (x / d * 0.699999988079071D); entity.motionY = 0.300000011920929D; entity.motionZ = (z / d * 0.699999988079071D); if ((entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer))) entity.attackEntityFrom(DamageSource.generic, 85 + this.rand.nextInt(2)); }if((entity instanceof EntityPlayer)){ entity.attackEntityFrom(DamageSource.generic, 35 + this.rand.nextInt(2)); } }
May 30, 201411 yr Author Bump: Got a progress on a while and create my own throwable but still it own render the lightning bolt when it spawn any help pleaes/ package mhfc.net.client.projectile; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class MHFCLightning extends EntityThrowable { public EntityLiving el; public long field_92057_e; private int fire; public MHFCLightning(World world) { super(world); } public MHFCLightning(World world, EntityLiving entityliving) { super(world, entityliving); } public MHFCLightning(World world, double d, double d1, double d2) { super(world, d, d1, d2); } /** * Called when the throwable hits a block or entity. */ protected void onImpact(MovingObjectPosition movingobjectposition) { worldObj.spawnParticle("hugeexplosion", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); if (movingobjectposition.entityHit != null) { if (!movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), 0)); } if (!worldObj.isRemote) { EntityLightningBolt entitylightningbolt = new EntityLightningBolt(worldObj, posX, posY, posZ); entitylightningbolt.setLocationAndAngles(posX, posY, posZ, rotationYaw, 0.0F); worldObj.addWeatherEffect(entitylightningbolt); } for (int i = 0; i < 8; i++) { worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D); } if (!worldObj.isRemote) { setDead(); } } }
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.