An addict was murdered in a dispute between two rival drug gangs using his flat as a base for their operations, a court heard.
Ross Ball, 42, was attacked at his flat in Langton Court, Sutton-in-Ashfield, on 1 November last year, and later pronounced dead in hospital.
Seven men have been charged with his murder, and an eighth is charged with assisting an offender.
All eight pleaded not guilty at Nottingham Crown Court.
The court heard Mr Ball had been letting drug dealers use his flat for about six months before his death.
John Lloyd-Jones QC, opening the prosecution, described the deceased as "a vulnerable man, and others were clearly taking advantage of him and his addiction to drugs".
- On trial for murder: Shaun Buckley, 29, of Lanchester Way, Solihull; Garry Cooper, 33, of Bramble Close, Nottingham; Anthony Daw, 25, of Cherry Grove, Smethwick; Jake Honer, 21, of Ludworth Avenue, Solihull; Matthew Jones, 23, of Denby Close, Birmingham; John McDonald, 25, of Stratford Road, Hall Green; Connor Sharman, 21, previously of Diamond Avenue, Kirkby-in-Ashfield
- On trial for assisting an offender: Adam Collins, 35, of Forest Road in Sutton-in-Ashfield
- Before the trial Buckley, Cooper, Daw, Honer, Jones and Sharman all admitted a charge of conspiracy to supply Class A drugs.
He told the court a drug dealing operation was being run by Garry Cooper that involved most of the other defendants.
In the days before Mr Ball's death, a "rival drug gang" took over the property and earlier on 1 November Jake Honer said he was attacked by three men while staying in a neighbouring flat, the court heard.
Mr Lloyd-Jones said this assault and the takeover were "the catalyst for what was to happen".
He said telephone records showing communication between the defendants "are evidence of plans being put into place".
"[They] were not going to stand for this, and they decided to retake poor Ross Ball's flat by force," he said.
The court heard Mr Buckley, Mr Daw, Mr Honer, Mr Jones, Mr McDonald and Mr Sharman drove to Sutton-in-Ashfield in two cars, both of which had false number plates.
Though he was in Mansfield at the time, Mr Lloyd-Jones said Mr Cooper was "directing and controlling events, giving orders to his men on the ground who were doing his bidding".
At about 22:30 GMT, the men entered Langton Court armed with machetes and baseball bats, and went to the door of Mr Ball's flat, jurors heard.
Mr Lloyd-Jones said the three men inside "were so terrified that they decided to escape from the flat by jumping out of a first-floor window", and while two escaped Mr Ball "wasn't so lucky" and was intercepted in the street.
A post-mortem examination recorded numerous blunt and sharp force injuries to his body, with some suggesting the use "of a broad-bladed or chopping type instrument such as a machete".
The injuries included an 8cm-deep wound near his left hip and a blow that "partially amputated" his right foot, which Mr Lloyd-Jones said "ultimately" led to his death.
Adam Collins helped Mr Sharman change the number plates on his car to avoid detection after the attack, the court was told.
The trial continues.