Invisibility potions are supposed to reduce the detection range. This doesn't work with shulkers in case the shulker is directly above or below the player. Shulkers would shoot at the player despite being up to 16 blocks away.
How to recreate. Use shulker egg - drink invisibility potion - stand directly above or below shulker up to 16 blocks away - shulker will start shooting
- relates to
MC-10901 Various mobs can see invisible players