In chapters 34-40, we see Tom and Huck setting up an elaborate escape plan for Jim, and making him do all sorts of things because that is how the prisoners in the books do it. Tom, who has an overactive imagination from reading too many adventure novels, has specific ideas about what a prisoner's life should be like, and what a daring escape should be like. In reality, Jim is being held in a little shack that is being guarded by a slave. They could have easily distracted the slave, lifted up the bed that was holding the chain to Jim's leg, taken the chain off, and left without anyone being the wiser. However, this isn't romantic, daring, or adventurous enough for Tom.
So, instead, they make a full grown man have snakes, rats and spiders for pets, cut himself so that he can keep a journal, send help messages, and create a coat of arms in his own blood (keep in mind Jim can't even read or write), give him a rope ladder in a pie (for a single-level shanty), and even devise ominous letters of warning that alert the entire neighborhood to the fact that they are escaping at a certain day and time-just to name a few of the things that Jim has to suffer through. All of these things are cruel. Jim, a grown man, who is actually a free man (Tom reveals this at the end; he knew Jim had been freed the entire time), is kept in a sweltering shanty as a prisoner, forced to bleed himself, and live with critters, all for the amusement of one little boy. Jim becomes nothing more than a plaything for Tom to act out his adventure fantasies. Huck protests the entire way, proposing more logical solutions at every turn, but doesn't ever insist, and so Jim, in the end, gets caught. The entire plan is cruel, and points out even more clearly the absurd notion that white people back in that time period certainly did think that black people were no more than property, to be done with as they pleased. Twain satirized that point the entire novel, but really brought it home in these chapters.