If you abandon the Lord and worship foreign gods, He will turn against [you], harm you, and completely destroy you, after He has been good to you."
"No!" the people answered Joshua. "We will worship the Lord."
Joshua then told the people, "You are witnesses against yourselves that you yourselves have chosen to worship the Lord." "We are witnesses," they said.
"Then get rid of the foreign gods that are among you and offer your hearts to the Lord, the God of Israel."
So the people said to Joshua, "We will worship the Lord our God and obey Him."
On that day Joshua made a covenant for the people at Shechem and established a statute and ordinance for them.
Joshua recorded these things in the book of the law of God; he also took a large stone and set it up there under the oak next to the sanctuary of the Lord.
And Joshua said to all the people, "You see this stone-it will be a witness against us, for it has heard all the words the Lord said to us, and it will be a witness against you, so that you will not deny your God."
Then Joshua sent the people away, each to his own inheritance.
After these things, the Lord's servant, Joshua son of Nun, died at the age of 110.
References for Joshua 24:29
They buried him in his allotted territory at Timnath-serah, in the hill country of Ephraim north of Mount Gaash.
References for Joshua 24:30