mojira.dev
MC-196556

When projectiles (such as arrows and tridents) move too fast, they can't be teleported by portals and end gateways

The bug

When the arrows, tridents and projectiles rate of fire is too fast, it can't be teleported by the portal, end gateway and nether portal.

Code analysis

Code analysis by @unknown can be found in this comment.

Related issues

Attachments

Comments

migrated
[media][media][media][media][media][media][media][media][media]
migrated

Can confirm.

[Mod] markderickson

Hi there!

Does MC-191947 describe the issue?

[Mod]Les3awe

@@unknown, is not.

[Mod]Les3awe

This issue is about the projectile acceleration too fast, causing the portal to fail detect the projectile.

Jeuv

This also seems quite location dependent. Moving closer to or further away from the portal changes whether the projectile goes through the portal or not. My hypothesis is that this is because projectiles don't check if they passed through a portal between two ticks.

Avoma

Can confirm in 20w51a.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w05a.

Avoma

Can confirm in 21w05b.

Avoma

Can confirm in 21w06a.

Avoma

Can confirm in 21w07a. Video attached.

Avoma

Can confirm in 21w11a.

ampolive

Can confirm in 1.17.1.

ampolive

Can confirm in 21w42a.

lovexyn0827

This is why it happens:

In Minecraft 1.16.1 and earlier versions, thrown projects checks if the OUTLINE shapes of blocks, to find potential collisions and chances to be teleported ("hit" a nether_portal block, for example)(See ThrowableProjectile.tick()). A portal has its non-empty OUTLINE shapes though it has no collision box which can stop regular entity movement, so thrown projectiles can always detect if it can be teleported no matter how high their velocity is.

But in 1.16.2-pre1, something was changed. The  OUTLINE shape get no longer used in collision checks, instead, the COLLIDER shape has been used since then (See ThrowableProjectile.tick() &  ProjectileUtil.getHitResult()). However, portals has empty COLLIDER shapes, so the teleporting check became dead code. And entities only stays in some seperated points, thus if the velocity of a thrown projectile entity is greater than 1 bloch per tick, it may pass through the portal if it failed to be teleported in the Entity.handleNetherPortal() method.

Suggestions to solve it:

The change may be intended to fix MC-73884, simply changing it back is not a good idea. But a addional ray trace may be introduced when the speed of the entity is higher than 1 block pre tick, just like what falling_blocks of concrete powder do.

[Mod]Les3awe

Still in the 24w33a.

[media]

[media]

[Mod]Les3awe

Shugoh

Confirmed

Platform

Normal

Projectiles

1.16.1, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, ..., 1.21, 1.21 Release Candidate 1, 1.21.1, 24w33a, 24w34a

24w33a, 24w36a

Retrieved