If your cat only urinates in the litter box but doesn't defecate there, you can try the following methods to resolve the issue:
1. Change the location of the litter box: The current location of the litter box may make your cat feel uneasy or inconvenient. Consider placing the litter box in a more well-ventilated, quiet, and easily accessible location, such as a place with less foot traffic in the house, or a place that meets the conditions of being secluded or having a "wide view".
2. Clean the litter box promptly: If the litter box isn't cleaned regularly, your cat may become reluctant to defecate in it due to its fastidious nature. It's recommended to clean the litter box daily and change the litter periodically to keep it clean. 
3. Try different litter box styles: Some cats may have specific preferences for litter box styles. You can try preparing several different styles of litter boxes to see which style your cat likes best.
4. Change to a larger litter box: If your cat urinates in the same litter box but doesn't defecate, it might be because the box is too small or inconvenient for them. Consider changing to a larger (or even extra-large) litter box to encourage your cat to defecate there.
The above methods can be tried according to the actual situation, and hopefully they can help the cat restore normal behavior.