Minecraft wiki entry for Boat, associated text: Boats can support two riders, including mobs. Except for endermen in Bedrock Edition, a mob cannot exit a boat and is trapped until the boat gets destroyed, or until the player uses a fishing rod or lead to remove the mob. This can be used to transport mobs, although hostile mobs still attack while in boats. Mobs riding a boat don't despawn,‌[Java Edition only] and don't count toward the mob cap.[4]