The golem targets nearby players and will choose either melee or ranged attack depending on the distance.
If the player is far enough, the golem will start forming a fireball and won't stop even if the player gets too close that the explosion would hurt the golem. After roughly 2 seconds, the fireball is shot at the player and the golem will either start making a new one, or use melee if the player is close to him.
If an explosion attempts to hurt the golem (for ex. his fireball), he will teleport away and cancel the damage. Then he will start attacking his target again, but will not be able to teleport for over 2 seconds, which would make him vulnerable to his next fireball.
To attack the Fire Golem using melee, it is suggested to use an Ender Pearl to teleport very close to him from a long distance to prevent him from creating fireballs.
A ranged attack would be more effective though, as the fireballs can be shot to repulse them back at the golem. Repulsing the fireballs requires good timing, because the golem teleports when an explosion hurts him, and the player has only a fraction of a second to shoot his next fireball, otherwise the teleport cooldown will run out.
- Whilst forming a fireball, the golem cannot move, but will keep looking at his target