According to The 39 Melochos, if a Jew should find himself up a tree when Shabbat comes down, he is obligated to stay in the tree until the end of Shabbat.
People may hand him things, but they may not touch the tree (trees are muktzeh) directly.
On the other hand, he may descend from the tree to (as the book charmingly and euphemistically puts it) “relieve his personal needs,” but he must return to the tree afterward.
Yes, this is funny. Friends don’t let friends climb trees before Shabbat.