Posted December 18, 20186 yr Hello, I have a tile that 'sucks' in nearby items, however, the motion of the items are super choppy, and seemed off-sycned. Is this a networking issue? If so how would I fix this? and here is the code applying the motion: Spoiler List<EntityItem> nearbyItems = this.world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB( this.getPos().getX()-10, this.getPos().getY()-10, this.getPos().getZ()-10, this.getPos().getX()+10, this.getPos().getY()+10, this.getPos().getZ()+10 )); if(nearbyItems.size() <= 0) return; for(EntityItem item : nearbyItems){ double moveFactor = 0.035d; item.motionX += (this.getPos().getX() - item.getPosition().getX()) * moveFactor; item.motionY += (this.getPos().getY() - item.getPosition().getY()) * moveFactor; item.motionZ += (this.getPos().getZ() - item.getPosition().getZ()) * moveFactor; item.move(MoverType.SELF, item.motionX, item.motionY, item.motionZ); } Currently developing: https://github.com/unassignedxd/Dynamic-Quarries
December 18, 20186 yr 2 hours ago, unassigned said: item.move(MoverType.SELF, item.motionX, item.motionY, item.motionZ); Don't call Entity#move, since the item is going to move on it's own each tick based on the motion values it has.Your movement is choppy because the item is moved twice per tick. Apart from that I don't know if there are solutions to the position desync that occurs, especially when collisions happen.
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.