Set up a settlement.. send them there.. don't go there...done.
Jamaica plains is rather small and I personally don't find it at all suitable for farming or water production, so if this was my problem that would be my first choice of where to send companions I didn't want to have to be bothered with anymore.
I learned NPCs are bad at going uptairs with no walls, so I built a tower made entirely of stairs and crafted my home up there. Nobody bothers me.
I will say the same goes for your enemies, I've built my compound on the island and as it currently stands there is no way in it unless I remove a wall, so last night I had some gunners (and some pain in the butt ones at that a missile won't even take one down) show up on the island, and sure enough one of them some how made his way in my house. how did he get in there is no doors or openings of any sort.
Sometimes, NPCs become hostile for no reason and *literally* try to kill me.
There are 3 main reasons why settlers attacks player 1) player take/steal something that is "red" 2) player kills Brahmins 3) player kills/attack settler. In some settlements, there may be items that is "red", just leave them alone.
Cheers,
-Klevs
I'd rather send them to Murkwater and turn them into fresh food for Mirelurk Queens lol
I understand all that (I'm up to level 77), but sometimes the game just completely glitches. I've seen settlers attacking non-hostile NPCs and brahmins, companions attacking me, one settler (but not others) attacking me, etc. I usually have to reload a save game, and/or run and fast-travel elsewhere.
There is another way.
I built up the Castle with walls covering up all of the breaches, plenty of turrets and artillery at every available point.
When it is attacked, the settlers have an annoying habit of running out of the protected walls and engaging the enemy in the open.
This really svcks if I just threw out an artillery signal smoke grenade.
If the settlers get hit by the incoming artillery, guess who they attack.
You!
Yet another way:
My NPC and I are approaching Diamond City, passing by a junk yard. We get attacked by some random, savage dogs.
While fighting, my NPC hits one of the vehicles in the junk yard, setting it on fire.
We wander off, a roving Diamond City Guard walks past the junk yard and a chain reaction explosion causes a car nearby to blow up.
Once again, guess who the guards attack.
YOU!
I found both these situations funny as heck, but they can happen and you will be attacked for something you really did not do.