Yassin Okako was detained by police last month after they found 61 wraps of crack cocaine and heroin when they searched him.
He pleaded guilty to possession with intent to Supply Class A drugs and possession of an offensive weapon.
A zombie knife was also found after a search warrant was carried out at his home.