The tag information to be tested can be found in the wiki on player data. In this case you are searching in Inventory for Slot information. This simply tests for the existence of Slot 20 which would mean there is any item stored in that slot.
What slot number is the off hand?
Equipment slots in macros
| Slot | Number |
|---|---|
| Trinket 2 (Bottom) | 14 |
| Back | 15 |
| Main Hand | 16 |
| Off Hand | 17 |
How to test for an item in a specific slot in a chest?
This can be done rather easily by matching part of the Items data tag of the chest block entity in a testforblock command: Replace with the coordinates of the chest. The -1 allows all data values of the chest (i.e. all orientations) to match.
How to detect if a player doesn’t have an item in?
Normally you’d also use a Count property when checking for an inventory item. So if you set Count to 0 you’d check if no items are present in the players inventory. I do that all the time man! Sometimes it just takes a “stepping back” second and you usually realize you are over-complicating stuff. lol
How to test for slot 20 in Minecraft?
This simply tests for the existence of Slot 20 which would mean there is any item stored in that slot. On the same wiki page for player data is an image which contains all the slot numbers. Update after question edit. This can be done with scoreboard objectives and scoreboard tags.
How do you test for slot information in Fortnite?
This is done by using the dataTag portion of the testfor command. The tag information to be tested can be found in the wiki on player data. In this case you are searching in Inventory for Slot information. This simply tests for the existence of Slot 20 which would mean there is any item stored in that slot.