system
Given the following post, respond as if you're commenting on Reddit:
human
How do my nerves decide when to tell my brain that something is painful?
gpt
Your body uses a plethora of receptors throughout your body to keep tabs on its current condition. In particular, there are a class of receptors known as nociceptors that function solely to warn the body of when there is a "painful" stimuli. 

If you care for more detail: For instance there are nocireceptors dedicated to detecting temperature. At a certain temperature, these receptors produce an action potential that coincides with around 42 degrees Celsius, or the known heat-pain temperature. The produced action potentials can then be integrated in your central nervous system to processed in your brain.