The bug
Shulker open and close hitbox is not updated, when they ride boat, minecart or mobs.
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 1
relates to 3
Attachments
Comments

Can confirm in 20w48a. You can use these commands to help reproduce this bug.
/summon boat ~ ~ ~ {Passengers:[{id:shulker}]}
/summon minecart ~ ~ ~ {Passengers:[{id:shulker}]}
Can confirm in 20w51a, however cannot in 21w03a. This issue has been fixed in 21w03a.
Please link to this comment in the description
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is because the method
net.minecraft.entity.monster.EntityShulker.onUpdate()
only updates the bounding box of the Shulker if the block position of it is notnull
. However, if the Shulker is riding another entity the block position is set tonull
. Another problem is that theEntityShulker
class is not overriding the methodnet.minecraft.entity.Entity.setPosition(double, double, double)
, which is for example called for the riding entity when the ridden entity moves. This method sets the bounding box based on the height, which theEntityShulker
class is not using.