Relocate tracker tick to fix MC-297196 #13094
Open
+44
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Up until 1.14, knockback would happen instantly on the tick after the packets are processed.
In 1.14, entity trackers now updated at the time of chunk ticking, rather than after entities were ticked. This causes the order to go like this:
Packet received on the server ->
(Next tick) Entity tracker forces an update ->
Entity ticks, updating its position according to the knockback
Since the entity ticks after the entity tracker sends the packet to the client, this causes a desync, as intended behavior is for the new position to be sent at the same tick. This inconsistency leads to the client receiving the new position of the entity at an arbitrary delay, between 1 tick and the update interval for the entity (for most mobs, 3), rather than immediately alongside their velocity, leading to a desync in position when an event occurs upon a packet being received (e.g. attacking) that causes knockback in an entity.