However the hostile does not need to be riding the golem, or vice versa. The only thing that seems to matter is the proximity. If they are occupying the same space (e.g. if you constantly /teleport one of them to the other), then the golem will begin to attack.
Confirmed for 1.15.2.
However the hostile does not need to be riding the golem, or vice versa. The only thing that seems to matter is the proximity. If they are occupying the same space (e.g. if you constantly /teleport one of them to the other), then the golem will begin to attack.