Minecraft wiki entry for Combat, associated text: When fighting one magma cube in a flat area, a trapdoor-like technique is often a safe way to kill them while avoiding taking damage. Stand just out of reach of the magma cube, and start walking toward them just before they jump. As they jump over the player, look up and hit them, but keep on moving. If done properly, the magma cube should be knocked over the player and they should be safe. If they are knocked sideways or backwards when the player hits them, move to avoid them. A sword enchanted with Knockback will also help. Sprint-hitting a cube also gives increased Knockback; however, it is much more difficult to hit them when moving faster. This technique requires practice, but may be the most reliable way to kill them without a bow.