There are various methods for building a carpenter bee trap, including a simple method using a 4-by-4 piece of wood and a mason jar and more complicated methods using wooden boxes. The traps work by attracting the bees into the light-filled jars while shading light on the way out.
To build a simple carpenter bee trap, drill one central 1/2-inch hole in the end of a 7-inch-long 4-by-4 block of wood. Drill four more 1/2-inch holes, one on each side of the 4-by-4 block, at a 45-degree angle upwards until they connect with the central hole. Drill another 1/2-inch hole in the center of a mason jar lid, and add two small holes on each side.
Screw the top of the mason jar lid to the bottom of the block of wood through the small holes, lining up the 1/2-inch hole with the central hole in the 4-by-4. Attach the mason jar to its lid, and hang the complete trap using a screw eye and string. Bees enter the trap and are attracted to the light in the jar, but they can't see light in the holes. Unscrew the mason jar to empty the trap once the bees are dead.
For a more complicated but better-looking trap, build a wooden box to which you can attach the jar. As with the 4-by-4 method, make sure to angle the 1/2-inch holes in each side of the box. The angle keeps the light from entering and showing the way out.