Original Answer: Lots of Guesswork
I don't think any currently-published materials address the effect of magic items on encounter difficulty, but the rules assume a certain volume of magic items-per-level, and the difficulty calculations and monster challenge ratings probably take that into account. However, if your PCs are exceeding the daily recommended allowance of magic items (very vaguely defined, but see addendum below), XP thresholds based on their true experience levels are almost certainly useless.
That being said, it's possible to compare the powers of magic items to the bonuses players get by gaining experience levels. A weapon that confers +1 to attack and damage rolls is functionally the same, in-combat, as gaining 2 points in the relevant ability score. An item that lets you cast a certain spell once per day is "the same as" gaining a spell slot.
Combat-oriented magic items denoted by the DMG as uncommon or rare have effects that amount to a fraction of the increase in power received by gaining a single level, at least in the low-level tier for which they're recommended (per DMG 135). At level 4, the Druid gets an ability score improvement (combat-equivalent to that +1 weapon), another 2nd-level spell slot (roughly combat-equivalent to that spellcasting item), some more hit points, and another hit die. So if you give both those items to a level 4 Druid, that PC is almost level 4, for combat purposes. You might want to calculate two different XP thresholds, treating the PC as level 3 and then as level 4, or you might want to split the difference between them.
This approach can't account for the versatility that magic items provide. To a Wizard who already can cast scorching ray, a circlet of blasting is a fairly disappointing reward, but to a hammer-oriented Champion Fighter it opens up a world of hands-free blasting possibilities.
Combat-oriented items denoted by the DMG as very rare or rarer provide bonuses that far outstrip the benefits of ascending from experience level 3 to experience level 4, and may even be equivalent to a full experience level or more for PCs at level 15 or above. I have no experience with high-level 5e and can't really speak to that. It's not hard to guess, though, that if you provide your players with a lot of very rare-rated magic items, your hopes of accurately calculating combat difficulty will fly out the window.
Addendum: Lots of Rolling on Tables
On close inspection, the DMG is actually fairly specific about how many magic items a party should get. It just happens to establish this in an extremely roundabout way. On page 133: "Over the course of a typical campaign, a party finds treasure hoards amounting to seven rolls on the Challenge 0-4 table, eighteen rolls on the Challenge 5-10 table, twelve rolls on the Challenge 11-16 table, and eight rolls on the Challenge 17+ table."
Rather than reproducing the Challenge 0-4 table and the many tables it references, I'll present here only a few relevant values. A treasure horde generated for CR 0-4 has:
- 36% chance of no magic items.
- 24% chance of 1d6 items from Magic Item Table A.
- 15% chance of 1d4 items from Magic Item Table B.
- 10% chance of 1d4 items from Magic Item Table C.
- 12% chance of 1d4 items from Magic Item Table F.
- 3% chance of 1 item from Magic Item Table G.
Now, Table G is a level 4 adventurer's dream. You have a 10% chance to get a +2 weapon, which is categorically overpowered for this tier. If that's not broken enough, you might end up with a mace of disruption or a wand of wonder. A 3% chance of rolling on this table at this tier seems like a bit much to me, but I'm no wizard of a coast.
This is what the guidelines tell us, though, so let's pretend to roll 7 times on the Challenge 0-4 table. If we apply my liberal arts degree's understanding of the law of averages, I predict we'll end up getting no magic items twice, roll a total of 2d6 times on Magic Item Table A, and roll 1d4 times each on tables B, C, and F.
Table A is 98% consumables and a couple of fairly mundane utility items. Rolling 7 times, we'd probably get 3 or 4 potions of healing, 3 or 4 low-level spell scrolls (hopefully from the spell list of a caster in your party!), and maybe—if you're really lucky—a driftglobe.
Table B is 64% consumables, a few somewhat more interesting utility items, and a very few items like mithral armor with fairly remote combat applications. We'll probably get a couple of fun potions, but let's say we picked up that mithral armor. I won't tell if you don't.
Rolling twice on Magic Item Table C, we might pick up a necklace of fireballs, but far more likely we'll get a couple rare-ish potions.
On Magic Item Table F, we're looking at stuff like a +1 weapon, a circlet of blasting, or some gauntlets of ogre power. That is, a couple of those "combat-equivalent to gaining part of a level" items described above.
By the end of the level 1-4 tier, we've amassed (and likely consumed) quite a few potions and scrolls. Their effect on combat isn't nothing, but it's not really enough to impact any combat difficulty calculations.
Despite several opportunities to pick up some overpowered weapons or equipment, our permanent acquisitions are probably limited to two or three rare-grade items. And these we have to split among the whole party! Only a very greedy and very lucky PC will be carrying enough magic items to be treated as one experience level higher for combat purposes. It might not be a bad idea, though, to calculate your XP thresholds as if one PC is one level higher, if the efficacy of one additional experience level is spread out across the entire party.
I will spare you my "calculations" for your campaign's treasure horde yields in the level 5-10 tier and above, but I notice those tables continue to draw a lot from magic item tables A, B, and C. Following the guidelines on page 133, PCs can't really rely on these treasure hordes to contain permanent magic items until the level 17+ tier. Suddenly the limit on attunement to a maximum of three items doesn't seem like a huge deal!
Of course, relying exclusively on these tables is going to make for one boring campaign. So many potions of giant strength! Magic items are used best as storytelling props, hand-picked for their roles in the scenarios you create. But the printed guidelines clearly intend for a given PC to pick up only a small collection of permanent magic items over his or her career. I can conclude with some confidence that the intended magic item distribution is so sparse as should not affect encounter difficulty calculations.
But that conclusion answers a different question! For present purposes, the upshot to this excess of analysis is that we now have a benchmark for what the 5e rules consider the correct number of magic items ("not very many"), and can gauge by our distance from that figure how overpowered our party is for purposes of encounter difficulty calculation.
Glib Extra Answer
If your PCs have so many magic items that the monsters you pit against them are no longer a challenge, try giving some magic items to the monsters.
Yes.
Anyone can attempt to use Sleight of Hand to steal something mid-combat. For most PCs, this will require their action to make this attempt. Others may be able to use their bonus action.
As for whether or not the creature uses its passive Perception or a contested check would largely fall to the DM's discretion. Personally, I would look to the description in the rogue class for this sort of action since two of the roguish archetypes in the PHB specifically call out Sleight of Hand.
First, the Thief archetype on PHB p.97:
Fast Hands
Starting at 3rd level, you can use the bonus action granted by your Cunning Action to make a Dexterity (Sleight of Hand) check, user your thieves' tools to disarm a trap or open a lock, or take the Use an Object action.
and on PHB p.98 under the Arcane Trickster archetype (emphasis mine):
Mage Hand Legerdemain
Starting at 3rd level, when you cast mage hand, you can make the spectral hand invisible, and you can perform the following additional tasks with it:
- You can stow one object the hand is holding in a container worn or carried by another creature.
- You can retrieve an object in a container worn or carried by another creature.
- You can use thieves' tools to pick locks and disarm traps at range.
You can perform one of these tasks without being noticed by a creature
if you succeed on a Dexterity (Sleight of Hand) check contested by the
creature's Wisdom (Perception) check.
In addition, you can use the
bonus action granted by your Cunning Action to control the hand.
In the case of Fast Hands, it is not specified and the choice of passive/contested would therefore be left up to the DM. For Mage Hand Legerdemain, it specifically states that it would be a contested check.
As a DM, I would first consider whether the creature was aware of your presence. In a case where you have not been seen (you were hiding before combat began), I would probably use the passive perception. However, if the creature is aware you are out there somewhere (you hid after it initially saw you) then it makes sense to me to use a contested check because the creature would be actively looking for threats at that point. If you weren't hidden at all and attempted to steal an item while engaged with the creature, I would probably also apply disadvantage if you couldn't give me a reasonable explanation of how you might do it without them noticing (see examples below). And of course, there are some items that I may rule were impossible to steal at that point in time.
Example 1:
The PC moves as if to grab the jailer, but it is really a distraction so he can palm the key sticking out from the jailer's vest pocket.
Example 2:
A rogue attacks with his main hand. At the end of his attack action, while the creature is still distracted by the attack weapon, his off hand darts in during his bonus action to steal a potion.
Example 3:
The barbarian attempts to steal a dagger from their opponent's belt sheath without any distraction at all.
In examples 1 and 2, I would allow them to roll contested checks. Example 3 would be rolled at disadvantage.
One last note, I would apply these same principles to any Sleight of Hand attempt used outside combat as well.
Best Answer
Remember that the Matrix is layered over the real world.
If he can physically see the gun, finding which icon belongs to it is super-simple; it's the one that's physically located in the same place. The only benefit they might get from running silent is making him waste an action to locate a handful of their weapons; that's if they're allowed to run silent. If they're run-of-the-mill security guards, not Corporate Special Ops, they're probably required to keep their gear aboveboard so HR can see they're at their posts and doing their rounds and such.
(Even if they are running silent, physically seeing the gun might allow the hacker target it without spotting it first. He knows where to "aim" and can fire away. But that's not directly supported by the book, so it's a GM call.)
The hacker's two main uses as far as combat is concerned are avoiding it and support. Since the hacker can see enemy personas without a physical line of sight (including camera icons) he can guide the team to avoid a gunfight. He can send false orders, turn off / fake a camera feed, and unlock doors to hiding places so they don't get caught. Even if they have to fight, he can already be disabling guns from well before the fight starts. If he can find a safe place to go into VR (like a troll teammate's back) he should be getting lots more turns than the meat fighters (not even counting sprites and agents), so the rate he can eject clips and smash guns is pretty impressive.
If the hacker isn't in VR, he still has a wider variety of combat actions available to him than anyone but magi - and he can ignore cover for half of them. Jam that gun, co-opt that turret, blind that cyber-sammy, eject that clip, add his team to that smartgun's friend-list so it won't fire on them, direct that drone to open fire, etc...