Automated Crossbow

The Automated Crossbow shoots at enemies when they are within a 24 block range. When you place these in the world they will have 15 Health and they can be picked back up again by sneak-right-clicking. You need to give them arrows to shoot. They have a 1 slot inventory but placing them on an upwards facing dispenser filled with arrows will auto refill them: