How do I use Item IDs in Commands?

To use the ID part in these hacks the number 5 will make it green, but 2 will make it orange and others.

/setblock ~~~ wool 5 
/setblock ~~~ wool 2
/setblock ~~~ wool 7
/setblock ~~~ wool 8

The number at the end will make the wool a different colour than white.


Solution 1:

To use the ID part in commands, the number 5 will make it green, but 2 will make it orange and others.

/setblock ~~~ wool 5 
/setblock ~~~ wool 2
/setblock ~~~ wool 7
/setblock ~~~ wool 8

The number at the end will make the wool a different color than white.