Posted January 24, 20187 yr I made an entity which should fall from the sky. It falls, but the hitbox seems to lag behind the actual entity. And when the hitbox is out of the View Frustum it doesn't render, thus creating a bug which I must remove. Registering the entity: ENTITY_COMET = EntityEntryBuilder.create().entity(EntityComet.class).id(InterstellarComets.MODID + ":" + "comet", 0).name("comet").tracker(64, 20, true).build(); Entity's onUpdate code: @Override public void onUpdate() { super.onUpdate(); this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; this.posX += this.motionX; this.posY += this.motionY; this.posZ += this.motionZ; if (this.posY <= 68) { //that it doesn't fall out of the map this.posY = 68; }else{ this.motionY -= getGravityVelocity(); } } protected float getGravityVelocity() { return 0.03F; } Edited January 24, 20187 yr by deerangle
January 24, 20187 yr Author What update frequency do living entities use? they seem to fall correctly.
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.