How to Build a Carpenter Bee Trap

I’ve done a lot to attract bees to my garden – planting flowers that they like, building them houses, etc. But carpenter bees? I’m not a fan. They do too much damage to our house, tree house and swing set each year for me to be on good terms with them. I’ve read article after article that says they only go after non-treated, rotting wood, but that hasn’t been my experience at all.