Skip to content

Instantly share code, notes, and snippets.

@Shadows-of-Fire
Created May 4, 2022 07:15
Show Gist options
  • Save Shadows-of-Fire/88ac714a758636c57a52e32ace5474c1 to your computer and use it in GitHub Desktop.
Save Shadows-of-Fire/88ac714a758636c57a52e32ace5474c1 to your computer and use it in GitHub Desktop.
Placebo .cfg File Specification

Intro

The CFG (Configuration) File Specification is a format utilized by Minecraft Mods that was originally developed by MinecraftForge. At this time, this format is no longer supported by Forge, but is still in use by a variety of mods.

This document only applies to mods utilizing the implementation that is bundled with Placebo. This document may be applicable to other implementations.

File Specification

Properties

Properties are the basis of the system. Each individual configuration element is a Property. A Property will take the form:

<K>:"<Name>"=<Value>

The breakdown of these elements is as follows:

  • <K> - This is the Type Key of this Property. There exists a finite list of possible Type Keys as described below.
  • <Name> - This is the Name (or Identifier) of this Property. Each Name must be unique for a specific Category.
    • These names are case-sensitive unless declared otherwise at the top of the configuration file.
  • <Value> - This is the Value of this Property. Valid values are defined by the Type Key.

The static elements of a Property, :, "", and =, are required and may not be moved or edited. There is a slight difference for Lists (see below).

Type Keys

Each property has a Type Key as defined by the first portion of their declaration. The following type keys are valid:

  • S - String - A character string. These are NOT surrounded in quotation marks "".
  • I - Integer - A single 32-bit integer, ranging from -2147483648 to 2147483647.
  • B - Boolean - A boolean value, true or false.
  • D - Double - A single 64-bit double. Supports decimal values like 1.25.
  • C - Color (Not Implemented
  • M - Mod ID (Not Implemented)

The Type Key of a property should NEVER be edited by a user. Mistyping a property will cause the file to error.

Lists

Any property may be a List. This is indicated by the lack of a = before the <Value> declaration. The = will be replaced with an opening <, followed by another line, and a closing >.

Each List Item will be of the type declared by the Type Key, and is newline-separated. No List Items are permitted on the opening (<) or closing (>) line.

Categories

Every property must be in a Category. A Category is simply a container object for Properties, and may contain zero or more Properties, as well as zero or more child Categories. A Category is indicated by the following declaration:

<name> {

Which begins a category with the ID <name>. All objects within this category will be placed before the closing }, which will end the category.

Comments

A Comment is started with #. Any text on a line that follows a # will be ignored. Comments are not permitted within configuration values.

@PlayerCalvin
Copy link

How can i increase the range of charms? For example DiamondSight?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment