Jonathan Bays, wearing a striped jail jumpsuit, appeared before a Mariposa County judge following his arrest after a dayslong manhunt.
As prosecutors outlined the events of the attack, Bays covered his face and shook his head.
"Jonathan stated he did not care," a prosecutor said during the hearing.
Bays faces multiple charges, including felony attempted murder and aggravated mayhem.
Prosecutors said he intended to kill and posed a threat to the community, an assessment the judge agreed with, denying bail.
Authorities say Bays attacked 32-year-old Andrew Cooper at the Creekside Terrace Apartments during a party after a dispute involving drugs.
Investigators said Cooper was slashed on his hands, neck, and face.
"It's ugly. It's a gruesome attack," Mariposa County Sheriff Jeremy Briese said. "I've not seen this sort of attack. I've seen many other incidents, but this one was new."
After several days of searching that left the community on edge, deputies located Bays on Wednesday, bringing the manhunt to an end.
According to the sheriff's office, Bays was found asleep in a tent after deputies searched for him at various homeless encampments.
"This guy was living off the grid with a very limited connection to technology and ability to track," Briese said.
Video released by the Mariposa County Sheriff's Office shows Bays smiling and speaking to the camera as he was escorted in handcuffs.
Deputies also recovered the sword believed to have been used in the attack, along with clothing they say Bays wore that night - including a black jacket, khaki pants and a camouflage hat.
During Thursday's hearing, the judge outlined Bays' criminal history, noting a current warrant out of Idaho, failure to register as a sex offender and 10 prior felony convictions dating back to when he was 18 years old.
"He has no regard for the law. He's violent, he skips town, he breaks the law and came to Mariposa. He found out really quickly. We don't tolerate it here," Briese said.
Cooper's family has been left devastated and is calling for justice. According to the district attorney's office, Cooper remains hospitalized at UC Davis Medical Center in a medically induced coma.
Bays is expected to return to court next Monday.
For news and weather updates, follow Brisa Colón on Facebook, Twitter and Instagram.