Alex Ross-King, 19, who died from a drug overdose at a music festival in New South Wales in January, took an unusually high amount of MDMA before arriving at the venue because she was afraid of being caught with the drugs by police.

On Monday the NSW coroner’s court heard Ross-King, from the NSW central coast, had consumed about three-quarters of an MDMA pill and was “pre-loading” on alcohol on a mini bus to the Fomo music festival in Parramatta in January.

When she arrived, counsel assisting the inquest Peggy Dwyer told the coroner on Monday, she consumed another two pills “apparently to avoid the risk of detection by police of carrying them into the festival”.

“She told her friends that [it was] because she was nervous about being caught by the police that she took the drugs like that, apparently to avoid the risk of being caught,” Dwyer told the inquest.

The day of the festival was hot – with temperatures between 31 and 34 degrees, Dwyer said in her opening to the inquest.

“One friend explains they were dripping with sweat after the five minute walk from the mini bus to the ticket gates at midday,” she told the inquest.

In the early afternoon, Ross-King sat under a tree with her friends drinking Vodka and red bull.

“She appeared to be very intoxicated and was sweating and looking flushed,” Dwyer said.

Her friends went to find water and ice to cool her, but by the time they returned she had already been taken to the medical tent, where, Dwyer said, she was “critically unwell”, with a body temperature of 41 degrees and a rapid and irregular pulse.

She was taken to Westmead hospital, where she arrived unconscious just after 5pm. About 10 minutes later she went into cardiac arrest. At about 9.15pm, after about four hours of attempted resuscitation, she was declared dead.

Ross-King’s death is one of six being investigated by the NSW coroner this week as part of an inquest into what Dwyer called “a recent substantial increase in the drug-related harms associated with a small number of music festivals” and an “unexpectedly marked increase” in the number of drug-related deaths.

The inquest is considering ways to prevent further deaths at music festivals, including harm-reduction measures such as what Dwyer called “drug-checking at festivals”, and issues around law enforcement at music festivals.

Ross-King’s death in January followed Joseph Pham, 23, and Diana Nguyen, 21, who attended the Defqon.1 festival in Penrith on 15 September. Nineteen-year-old Callum Brosnan died at the Knockout Games of Destiny at Sydney Olympic Park on 9 December and Josh Tam, 22, at the Lost Paradise festival on the central coast on 29 December.

Hoang Tran, known to his family as Nathan, is the sixth case to be examined in the inquest. He died after attending Knockout Circuz in December 2017.

One, 19-year-old Brosnan, was believed to have taken between six and nine caps. An analysis of one leftover pill found it had a 76% purity, “a very high purity”, Dwyer said.

“There is no certainty that the remainder of the drugs he took were of the same purity, but it is suggestive that they were,” she said.

The inquest is considering, among other things, the impact that a strong and very visible police presence has at music festivals.

In Ross-King’s case, Dwyer said, the presence of police at the festival appeared to be a direct cause for her decision to “double dose” or “double dropping”; taking more than one pill at once, something she said was common.

Studies in Australia have shown that almost half of people who used ecstasy at a festival had “double dropped”.

“I expect that your honour will hear that this is done, as in the case of young Alex, to avoid being caught by police and charged with a criminal offence,” Dwyer told the court.

She said that while police and security often played a “vital role” in responding in the case of a medical emergency, the “presence and behaviours” of police and security can “exacerbate the risks associated with drug use”.

“After the deaths this summer, NSW Health interviewed a number of patrons who had suffered an adverse reaction to drugs in order to understand the patterns of use,” Dwyer said.

“A number of participants reported that their risky behaviours were driven by fear of police, including taking drugs prior to arrival at the event and avoiding the medical centre or open disclosure of substance use.”

On Monday morning Dwyer described the “common themes” surrounding all six deaths. Each had consumed more than one MDMA tablet or cap, the primary cause of death in all cases.

In some cases, such as Ross-King and Tran, the victims were seen to act aggressively or erratically before their deaths, in a way that was out of character. Heat at the music festival venue was a factor in all of the deaths, and most had extremely high body temperatures before their deaths.

“Once body temperatures rise above 40 degrees celsius the body’s ability to regulate its own temperature becomes severely impaired,” Dwyer said.

“At this point, temperatures continue to rise, leading potentially to multi-organ failure, impaired blood clotting and ultimately cerebral oedema. Mortality from drug induced hyperthermia with temperatures above 40 degrees celsius is high.”

Dwyer also told the inquest that in all of the cases their children’s drug use came as a shock to their parents after their death. Of Brosnan, Dwyer said: “Like all the young people subject to this inquest, because he functioned so well and was doing so well in life, was so clever and creative and getting on with his life as responsible young adult, Callum’s parents were not aware of any interest in drugs.”

The inquest comes against the backdrop of increasing calls in NSW for the introduction of pill testing at music festivals, despite the steadfast opposition of the state government and premier, Gladys Berejiklian.

The Royal Australasian College of Physicians, the Australian Medical Association, the Royal Australian College of General Practitioners and the former Australian federal police commissioner Mick Palmer have all called for the testing to be allowed at festivals.

The deputy state coroner, Harriet Grahame, will preside over the two weeks of hearings in the inquest.

“These are your children but they could just as easily be the children of my own community or my own family,” she said at the opening of the inquest on Monday.

“They could be any young people who go to music festivals and partake in drugs as many young people do.

“These are our young people ... and we owe them a proper investigation of the circumstances in which they died.”