๐ @bridge/com-mojang
This module allows access to the com.mojang file system. View Source Code
js
import { ... } from "@bridge/com-mojang"
๐ผ Variables
setup
A signal that states whether the com.mojang folder has been setup by the user.
- Type:
Signal<void>
js
// Wait for the com.mojang folder to be setup before interacting with it
await setup.fired
// ...
// Check that the com.mojang folder has already been setup
if (setup.hasFired) {
console.log('com.mojang linking has been setup')
}
โก Functions
requestFileSystem
The requestFileSystem
function returns the com.mojang file system instance.
- Signature:
requestFileSystem()
- Returns:
Promise<FileSystem>
js
const comMojangFs = await requestFileSystem()
if (await comMojangFs.directoryExists('test')) {
console.log('The folder "test" exists in the com.mojang folder.')
}
TIP
This file system instance will have the same methods as the @bridge/fs module, except for the onBridgeFolderSetup
method.