EntityShulkerBullet.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:Backmemed 作者:
protected void bulletHit(RayTraceResult result)
{
    if (result.entityHit == null)
    {
        ((WorldServer)this.world).spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 2, 0.2D, 0.2D, 0.2D, 0.0D, new int[0]);
        this.playSound(SoundEvents.ENTITY_SHULKER_BULLET_HIT, 1.0F, 1.0F);
    }
    else
    {
        boolean flag = result.entityHit.attackEntityFrom(DamageSource.causeIndirectDamage(this, this.owner).setProjectile(), 4.0F);

        if (flag)
        {
            this.applyEnchantments(this.owner, result.entityHit);

            if (result.entityHit instanceof EntityLivingBase)
            {
                ((EntityLivingBase)result.entityHit).addPotionEffect(new PotionEffect(MobEffects.LEVITATION, 200));
            }
        }
    }

    this.setDead();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号