Residents had to be evacuated after a tenant doused his council flat and a communal stairwell in paraffin.
Police arrived at John Ruse's flat to find "puddles" of flammable liquid inside the property.
A court heard Ruse had become "delusional" after taking amphetamines at the time of the incident in Castleford.
He was dressed in a suit but had nothing on his feet when residents saw Ruse pouring the liquid in the stairwell and on the path outside the property.
Police were contacted and evacuated residents from the flats.
Ruse had two cigarette lighters in his pocket when he was arrested.
An officer described how the inside of Ruse's flat had been "completely doused" in paraffin.
A Wakefield District Housing officer said the smell of the liquid was "overwhelming."
Prosecutor Phillip Evans said: "Within the flat there were puddles of liquid on the floor.
"It was on the walls and the furniture was also wet. The stairs were completely covered in liquid."
Leeds Crown Court heard Ruse had "stockpiled" paraffin inside his flat.
A day before the incident had bought a hand-held can of diesel from a petrol station.
The prosecutor said the flat had been left uninhabitable and it cost £18,000 to replace the damage.
Ruse was interviewed about the incident and admitted that he realised what he had done was "going to be dangerous" but denied any intention to ignite the liquid.
Ruse pleaded guilty to criminal damage being reckless as to whether life was endangered.
James Littlehales, mitigating, said Ruse suffered from mental health problems which had been made worse by his use of amphetamines.
He said: "He was delusional and the suggestion is that he had been trying to clean the flat and communal area, bizarre as that may be."
Ruse was jailed for two years, eight months.
Recorder David Gordon said: "It is a concerning feature of the case that you had bought diesel the day before and had made a deliberate effort to stockpile paraffin for a particular purpose.
"None of the material was set alight.
"One fears to think about what the consequences might have been."