OK, here's your super-cheatcode method for working out what the Major and minor chords are in whatever key you're in in one simple move.
No, really.
Somethings to know that are useful before we get to it though are
Now, like many things on the bass neck, there are patterns that are universal in how they apply no matter what Key you're in and this is one of them.
So, what's happening here?
If you start on any note, in this instance it's C, and follow the pattern of the Green notes, you will land on the root notes of ALL 3 Major chords in the scale (C-F-G which is also 1-4-5 in the Nashville Number System).
If you then move down the neck by 3 frets and make the pattern of the Yellow notes, using the same shape you just made, you will land on the root notes of ALL 3 minor chords in the scale (A-D-E which are 6-2-3 in the Nashville Number System)
Then you close that box shape with the Red note for the random, odd one out, Dimished chord that you'll almost certainly never use outside of Jazz.
Let's apply this shape to another Key and see if it works. Lets start on A♭ and work through the scale of A♭ Major.
We're in A♭ Major (A♭-B♭-C-D♭-E♭-F-G) so we start on A♭ at the 4th fret on the E String and play the 3 Green notes which gives us A♭-D♭-E♭ which are the root notes of the Major chords in the Key of A♭ Major. Again, these are the 1-4-5 chords of the Nashville Number System.
Then we move down 3 frets and we're on F. We play the 3 Yellow notes, F-B♭-C which gives us the root notes of all the minor chords in A♭ Major.
The we close the box with to get the Diminished Chord, G.
Here's a useful little sidenote: when you start this pattern on the root note of the Key and move down 3 frets to get to the root notes of the minor chords, the note you're landing on is the root note of the Relative minor Key for whatever Major Key you're in.
In C, in the first example, we start on C and move back 3 frets to get the minor chords. Doing this, we land on A. A is the root note of the Relative minor Key of C Major.
So you've by learning this pattern you're also learning something else by stealth!
But this pattern is even more useful. It can teach you all the chords of the minor scale too...
Let's take the Scale/Key of B minor (B-C#-D-E-F#-G-A).
If we take our pattern and "reverse" it, by which I mean instead of the Green notes being the Major Chords, they're now the minor chords, and we start on B and play the Green notes we get all 3 of the minor chords in B minor (B-E-F# which is the minor 1-4-5 in the Nashville Number System).
Then, if we move UP the neck by 3 frets (remember we move DOWN in the Major Keys) and play the Yellow notes, we get the Major chords of B minor.
To get that pesky Diminished chord, we simply move back DOWN one fret. This pattern isn't quite as elegant as the Major one with that little nudge back for the Diminished chord but it works.
There is a more roundabout way you can work out the minor chords and some might find it easier, others might find it clunkier...
Let's say someone calls a song in D minor. You can use the Major pattern to work out the chords of the minor by starting on D, moving UP 3 frets to F and then using the Major Scale Pattern to work out the chords because they are the same chords in both D minor and F Major.
Might be easier, might be more lumpy. Up to you 👍🏽
So there you have it; use these patterns and concepts to work out the Major and minor chords in any key.
Enjoy.