-
Notifications
You must be signed in to change notification settings - Fork 4
Commands
Cave Generator comes with a number of commands designed to facilitate the process of creating and testing your caves. Here's a table showing you each of the commands along with their required arguments (inside of <>), optional arguments (inside of []), and a brief description.
| Command | Description |
|---|---|
/cave list |
Lists all caves with buttons to enable or disable them. |
/cave test |
Puts you in spectator mode and applies night vision. |
/cave reload |
Reloads your presets immediately. |
/cave jump |
Teleports the player 1,000 blocks in each direction. |
/cave new <name> |
Generates an empty preset named <name>
|
/cave enable <name> |
Enables /presets/<name>. |
/cave disable <name> |
Disables /presets/<name>. |
/cave tojson <name> |
Converts a file in /presets to regular JSON. |
/cave tohjson <name> |
Converts a file in /presets to Hjson. |
/cave expand <name> |
Replaces variables in /presets/<name> with concrete values. |
/cave compress <name> |
Converts /presets/<name> to unformatted JSON. |
/cave combine <path> <name> |
Copies a value from one preset into another. |
Running /cave list will display all of the presets in your presets directory. Beside each preset, you will see a button, either [ENABLE] or [DISABLE], which can be clicked on to quickly enable or disable this preset. You do not need to reload for this change to take effect. This change will take effect once you travel out into new chunks.
Running /cave test will change your game mode to spectator mode and apply night vision for as long as possible. You can use this to explore underground and view your caves in their entirety.
Running /cave reload will reload all of the presets in your preset directory and apply changes immediately. Remember that Cave Generator does not do retroactive generation, so current chunks will not be affected. You will see changes upon exploring into new chunks.
Running /cave jump will teleport the player 1,000 blocks in each direction. This is useful for exploring out into new caves to see the changes you made in effect.
Running /cave new <name> will generate a new preset with the following contents:
enabled: true
This new preset will be extended with .cave regardless of which extension you put in the argument.
Running /cave enable <name> will enable the preset /presets/<name>.
Running /cave disable <name> will disable the preset /presets/<name>.
Running /cave tojson <name> will convert the preset /presets/<name> to regular JSON. The original preset will be moved into /config/cavegenerator/backup and the new preset will be written as /presets/<name>.json.
Running /cave tohjson <name> will convert the preset /presets/<name> to Hjson. The original preset will be moved into /config/cavegenerator/backup and the new preset will be written as /presets/<name>.cave.
Running /cave expand <name> will write the expanded form of /presets/<name> as /generated/<name>. The term expanded specifically refers to all variables inside of root.variables and imports from root.imports being written as the concrete values they refer to. This can be useful if your preset uses imports and you want to export it as a single file.
Running /cave compress <name> will write /presets/<name> as /generated/<name>.json with no formatting applied, thus leaving it relatively compressed. Arrays with single values will also be stripped and converted into regular values. I am expecting other compressions to be applied in future versions, as well.
Running /cave combine <path> <name> will copy a JSON value from one preset into another. <path> is the JSON path to a single value, where the first component is the name of the file.
Here's an example that might help explain what's going on. Imagine these are the contents of demo.cave:
list: [
{
a: {
b: c
}
}
]
The path to b, which holds the value c looks like this: demo.list[0].a.b. You can see that object access is handled with a . and array access is handled by an index inside of [], starting at 0.
Here's a more practical example copying a tunnels object from one preset, demo.cave, to another, into.cave:
/cave combine demo.tunnels into
After running this command, into.cave will have the same tunnels object as demo.cave. Note that /cave combine is able to copy values multiple levels deep between presets, but it will always be placed in the equivalent location.
In all of the examples above, the argument <name> can be written either with or without the file extension. It will always refer to one of the presets inside of config/cavegenerator/presets.
Cave Generator lets you run multiple subcommands together using the && operator.
Here's a helpful example that will reload all of your presets and jump you immediately into new chunks so you can see your changes in effect:
/cave reload && jump
Home | About | Getting Started | Hjson | FastNoise