So basically, you can toggle cheats off for a world (hardcore defaults enable it) and you can't cheat. But you can host a single-player world to LAN, and while you do that, you can enable cheats in the hosting options. So I have noticed, while playing on hardcore which doesn't allow people to cheat, you can use commands after hosting to LAN. This also applies to worlds you disabled "allow cheats" in creating world options. And this applies to most versions but I clicked 1.20.4 cuz it requested a version
Related issues
Comments


annoying cuz your friends or youtubers can cheat while claiming they didn't since they are on cheat-free world

by "cheats" i mean using vanilla commands such as /gmc and /give

Thank you for your report!
We're actually already tracking this issue in MC-134, so this ticket is being resolved and linked as a duplicate.
However, that ticket has been resolved as working as intended, which means that this will not be fixed as it is not considered a bug.
Please be sure to use the search feature before creating a ticket to see if the issue has already been reported.
Quick Links:
📗 Tracker Guidelines – 🛠 Community Support – 📧 Mojang Support – 🔑 Account Support – ✍️ Feedback Discord – 💬 Mojira Discord

so you are telling me it is intended to have an option to cheat in hardcore. then whats even the point of allow cheats off and hardcore non-revivable death?
If I was not clear, here's a summary :
If you host a world to LAN you can enable cheats on worlds you aren't supposed to be able to cheat on (single-player)