洞穴夜莺
  1. private static final DataParameter<Float> Yaw = EntityDataManager.<Float>createKey(EntityMagicBullet.class, DataSerializers.FLOAT);
  2.         private static final DataParameter<Float> Pitch = EntityDataManager.<Float>createKey(EntityMagicBullet.class, DataSerializers.FLOAT);
  3.         
复制代码

Yaw和Pitch不需要自己管理,EntityThrowable已经处理好Yaw和Pitch的问题,你这样反而容易出错



  1.     public void onUpdate(){
  2.                 int i=this.getTime();
  3.                 this.setTime(--i);
  4.                 if(i<=0) {if(!this.world.isRemote) {this.setDead();}}
  5.                 World world=this.getEntityWorld();
  6.                 double[] pos= {this.posX,this.posY,this.posZ};
  7.                 world.spawnParticle(EnumParticleTypes.DRAGON_BREATH, true, pos[0], pos[1], pos[2], 0, 0, 0, 1);
  8.                 //this.setPosition(pos[0], pos[1]+(w+0.3f), pos[2]);
  9.         }
复制代码

这里最好调用一下super.onUpdate()

第一页 上一页 下一页 最后一页