Fallout 4 legendary weapons

Legendary weapon effects are special modifications applied to basic weapons in Fallout 4 that use special prefix modifiers, not obtainable elsewhere.

Characteristics
Legendary weapons cannot be scrapped, but can be further modified and traded with vendors. An on-screen notification informs the player that they have picked up a Legendary weapon; in the Pip-Boy's inventory screen, they are marked with a star.

Location
Legendary weapons are most commonly found on the bodies of "Legendary" variants of enemies. These enemies spawn at random locations throughout the Commonwealth, the Island, and Nuka-World, depending on the difficulty setting, and will almost always have a legendary piece of equipment in their inventory, either a Legendary weapon or Legendary armor. Legendary weapons can also be awarded for completing certain quests and can be found in tribute chests.

Legendary weapon prefixes
Legendary weapons will have one of the following prefixes, which acts as a short description of the weapon's effects.

Unique weapon effects
Some effects are not randomly generated legendary weapons. These are known as unique weapon effects, and they can only be found by adding the effect through commands, or getting the unique weapon that they are found on.

Console commands
Legendary effects can be added to items through the console by following the next steps:
 * 1) Drop the item on the ground.
 * 2) Pick up the item in the air by holding E (how you would normally drag ragdoll and other objects around).
 * 3) Open console and enter "GetPlayerGrabbedRef." This returns the RefID of the item you're holding in the air.
 * 4) Take note of the returned RefID.
 * 5) Look up the ModID below for the desired legendary weapon effect, note it as well.
 * 6) Enter the following in the console (substitute the appropriate RefID and ModID):
 * 7) For example, you would enter in something like this:.
 * 8) The item will drop to the ground, and when you go to pick it up, you will get an overview similar to the one you get when you pick up any given legendary item for the first time.

As a simpler alternative to points 2 - 4 you can simply left-click on the item when it is lying on the floor. The RefID will then be displayed on-screen just as if you used the mentioned console command. Bear in mind certain weapons can be unusually challenging to left-click when dropped, so if this is unsuccessful, use instead.

You can't stack several mods on a single item, but you can replace a mod with another one via the console.