[Godot 3.5.1] How can you replace (or block) classes for certain nodes?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By TheTechRobo

I’m going to be writing something that accepts custom PCK files and runs a scene inside of them as a child node. These PCK files can be written by anyone.

I want to implement some form of sandboxing. At the very least, for now, I want to block access to classes like File and OS, and make a new File class that only allows reading and writing to certain areas (but for that, I’d need the File class to still be accessible to a parent node). I feel like the reason why I’m doing this is fairly understandable - security etc. Is this possible without modifying the engine? Also, how secure would this actually end up being in practice?

One final note: I can’t use Godot 4 for this project, although I can probably upgrade to 3.5.2 if necessary (I just don’t want to unless it’d be helpful because hassle).

You could take a look at DeltaV Rings of Saturn, a modder with the help of the creator created a mod loader for it. https://blog.cy.md/2022/05/27/modding-for-godot/

Merlin1846 | 2023-04-06 04:24

Found a Godot proposal for this:

Implement a Sandbox mode · Issue #5010 · godotengine/godot-proposals · GitHub

Looks like this isn’t in the engine at the moment. :confused:

TheTechRobo | 2023-04-06 20:40