Posted July 7, 201312 yr My entity doesn't explode if it hits a block while a say it has to ,, am i using the wrong if statement? package invizzble.mods.nc.entities.projectiles; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.effect.EntityWeatherEffect; import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntityStaffODarknessAmmo extends EntityThrowable{ public EntityStaffODarknessAmmo(World par1World) { super(par1World); } public EntityStaffODarknessAmmo(World par1World,EntityLivingBase par2EntityLivingBase) { super(par1World, par2EntityLivingBase); } private int explosionRadius= 3; @Override protected void onImpact(MovingObjectPosition par1Movingobjectposition) { if (par1Movingobjectposition.entityHit != null) { byte b0 = 30; par1Movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); this.setDead(); } if(!this.worldObj.isRemote){ // i found the !this.worldObj.isRemote int the entityEgg and the EntitySnowball, why doesn't it explode? this.worldObj.createExplosion(this, this.chunkCoordX, this.chunkCoordY, this.chunkCoordZ, explosionRadius, true); } } @Override protected float getGravityVelocity() { return 0F; } } http://i.imgur.com/sKDS7bj.png[/img] http://www.minecraftforum.net/topic/1877292-15x-forge-smp-nightmarecraft-alpha-10-it-started-with-a-dream-new/
July 7, 201312 yr this.worldObj.createExplosion(this, this.chunkCoordX, this.chunkCoordY, this.chunkCoordZ, explosionRadius, true); Surely you want .posX, .posY, and .posZ?
July 7, 201312 yr Author oh god --' that was a stupid one --' thanks http://i.imgur.com/sKDS7bj.png[/img] http://www.minecraftforum.net/topic/1877292-15x-forge-smp-nightmarecraft-alpha-10-it-started-with-a-dream-new/
July 7, 201312 yr You were also telling the entity to die before it even checked that wether it was client or server... You are supposed to this.setDead(); in the if(!this.worldObj.isRemote) statement I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes. I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there
July 7, 201312 yr Author yes that one was already fixed you know, it's like 2am here http://i.imgur.com/sKDS7bj.png[/img] http://www.minecraftforum.net/topic/1877292-15x-forge-smp-nightmarecraft-alpha-10-it-started-with-a-dream-new/
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.