A bayonet is a bladed weapon that is affixed to the front of a gun, usually as a secondary weapon for close-quarters combat. Bayonet charges were common in the early years of gunpowder warfare, but the advent of self-loading weapons rendered these a waste of manpower. Bayonets were standard in World War I, used to devastating effect if an attacking force got into the enemy's defensive trench. In World War II, they were also widely used, especially in the urban warfare environments of Europe where close quarters might make aiming the gun cumbersome, or gunfire could compromise the stealth of a soldier. They were also used in the jungles of the Pacific theater, often to clear brush. Modern warfare tactics have largely mitigated the use of the bayonet, yet it remains in use in many environments.