Can the general hide behind its own pieces in xiangqi?
These answers restate the rules implemented by our open-source engine, which follows the WXF laws for movement, checkmate and both repetition rulings: a side that forces a repetition by perpetual check or perpetual chase loses rather than drawing. The chase half has not been validated against the official casebook. Where an answer refers to a specific position, that position lives on the linked reference page, where the build verifies it before publishing.
Direct answer
Yes, in effect. The general never physically hides anywhere, it can only ever stand on one of nine fixed points, but a well-placed advisor or elephant blocking a chariot's line or occupying a point an attacker needs works exactly like shelter. A well-defended palace is a fortress the general sits inside, not a maze it navigates.
What good shelter actually looks like
Both advisors in their starting corners, both elephants intact and defending each other, and no undefended gaps on the central file, is the classic solid structure. It denies an attacker both the screens a cannon needs and the open lines a chariot needs, without the general moving at all.
Why removing that shelter is so dangerous
Trading away an advisor or elephant, even for equal material, can open exactly the point or line an attack was missing. This is why strong players are often reluctant to trade defenders even when the trade looks materially fine on paper.
Related questions
Is it better to keep the general in a corner or the centre for this kind of shelter?
It depends on the specific structure, but a general with defenders on both sides tends to be safer than one exposed on an open file.
Do elephants contribute to this shelter even though they spend most of their time outside the palace?
Yes. An elephant can stand on only one palace point, its front centre, but both elephants defend the approach to the palace, especially against horses and soldiers, before an attacker even reaches it.