Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EntityCelestialBolt extends EntityThrowable {
- public static final float explosionPower = 0.75F;
- public EntityCelestialBolt(World world) {
- super(world);
- }
- public EntityCelestialBolt(World world, EntityLivingBase entity) {
- super(world, entity);
- }
- private void explode() {
- int bx = (int) posX;
- int by = (int) posY;
- int bz = (int) posZ;
- world.createExplosion(this, posX, posY, posZ, 0.75F, true);
- setDead();
- }
- @Override
- public void onUpdate() {
- super.onUpdate();
- if (ticksExisted > 20) {
- explode();
- }
- for (int i = 0; i < 10; i++) {
- double x = (double) (rand.nextInt(10) - 5) / 8.0D;
- double y = (double) (rand.nextInt(10) - 5) / 8.0D;
- double z = (double) (rand.nextInt(10) - 5) / 8.0D;
- world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, posX, posY, posZ, x, y, z);
- }
- }
- @Override
- protected float getGravityVelocity() {
- return 0.005F;
- }
- @Override
- protected void onImpact(RayTraceResult result)
- {
- {
- if (result.entityHit != null)
- {
- //this.doAwesomeEffectMethodHereWhenIWork(result);
- }
- this.setDead();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement