The Testfor Command - Part 1

The /testfor command is an essential command for almost every adventure map or command creation. We will split /testfors into multiple parts, because they have almost infinite different setups. For this part. we will focus on player /testfors, specifically holding tests.

Overview - Part 1
The /testfor command tests if there is a entity within the radius specified, with the specific data value that is inserted into the /testfor.

Syntax
/testfor  {SelectedItem:{id:"minecraft:",tag:{display:{Name:"Item Name" }}} }

Explanation
This will test if the selected player is holding the certain item with the certain name, only if it's in their hand. The item value is simple: the item you're testing for if held.

Trivia

 * This command is arguably the most used command in adventure maps.