- private static final DataParameter<Float> Yaw = EntityDataManager.<Float>createKey(EntityMagicBullet.class, DataSerializers.FLOAT);
- private static final DataParameter<Float> Pitch = EntityDataManager.<Float>createKey(EntityMagicBullet.class, DataSerializers.FLOAT);
Yaw和Pitch不需要自己管理,EntityThrowable已经处理好Yaw和Pitch的问题,你这样反而容易出错

- public void onUpdate(){
- int i=this.getTime();
- this.setTime(--i);
- if(i<=0) {if(!this.world.isRemote) {this.setDead();}}
- World world=this.getEntityWorld();
- double[] pos= {this.posX,this.posY,this.posZ};
- world.spawnParticle(EnumParticleTypes.DRAGON_BREATH, true, pos[0], pos[1], pos[2], 0, 0, 0, 1);
- //this.setPosition(pos[0], pos[1]+(w+0.3f), pos[2]);
- }
这里最好调用一下super.onUpdate()