Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 532 Bytes

File metadata and controls

25 lines (17 loc) · 532 Bytes

secrets

JSON format for secrets.json

{
    "mySecret": "Foo bar" // string to string only
}

The file is located in config/<pack_id>/secrets.json.

To load the secrets in Minecraft:

import { secrets } from "@minecraft/server-admin";

// A list of available, configured server secrets.
console.warn(secrets.names);

// Returns the value of secret that has been configured in a dedicated server configuration JSON file.
console.warn(secrets.get("mySecret"));

Example script: secrets.js