<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Introduction to HOCON &mdash; Sponge 6.0.0 documentation</title>

    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>




    <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />

    <link rel="stylesheet" href="../../../_static/spongedocs.css" type="text/css" />

        <link rel="index" title="Index"
              href="../../../genindex.html"/>        <link rel="search" title="Search" href="../../../search.html"/>    <link rel="top" title="Sponge 6.0.0 documentation" href="../../../index.html"/>        <link rel="up" title="Configuring Sponge" href="index.html"/>        <link rel="next" title="JSON Syntax" href="json.html"/>        <link rel="prev" title="Configuring Sponge" href="index.html"/>
    <!-- Google Analytics -->
    <script>
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-59476017-2', 'auto');
        ga('send', 'pageview');
    </script>

  <script src="../../../_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
    <div id="sp-logo-container" class="page-scroll">
        <a class="logo" href="../../../index.html">
            <img src="../../../_static/spongie-mark-dark.svg">
            <span>Sponge</span>
            <i class="fa fa-fw fa-chevron-down"></i>
        </a>
        <div id="sp-logo-menu">
            <ul id="sp-logo-dropdown">
                <li><a href="https://www.spongepowered.org"><i class="fa-fw fa fa-home"></i>Homepage</a></li>
                <li><a href="https://forums.spongepowered.org"><i class="fa-fw fa fa-comments"></i>Forums</a></li>
                <li><a href="https://github.com/SpongePowered"><i class="fa-fw fa fa-code"></i>Code</a></li>
                <li class="active"><a href="https://docs.spongepowered.org"><i class="fa-fw fa fa-book"></i>Docs</a></li>
                <li><a href="https://jd.spongepowered.org"><i class="fa-fw fa fa-graduation-cap"></i>Javadocs</a></li>
                <li><a href="https://forums.spongepowered.org/c/plugins/plugin-releases"><i class="fa-fw fa fa-plug"></i>Plugins</a></li>
                <li><a href="https://www.spongepowered.org/downloads"><i class="fa-fw fa fa-download"></i>Downloads</a></li>
                <li><a href="https://www.spongepowered.org/chat"><i class="fa-fw fa fa-comment"></i>Chat</a></li>
            </ul>
        </div>
    </div>

<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
                <ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Creating a Server</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Getting Started</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../jre.html">Installing Java</a></li>
<li class="toctree-l3"><a class="reference internal" href="../migrating.html">Migrating to Sponge</a></li>
<li class="toctree-l3"><a class="reference internal" href="../implementations/index.html">Choosing an Implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../launch-script.html">Creating a Launch Script</a></li>
<li class="toctree-l3"><a class="reference internal" href="../port-forward.html">Port Forwarding</a></li>
<li class="toctree-l3"><a class="reference internal" href="../bungeecord.html">Using Sponge with BungeeCord</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="index.html">Configuring Sponge</a><ul class="current">
<li class="toctree-l4 current"><a class="current reference internal" href="#">Introduction to HOCON</a></li>
<li class="toctree-l4"><a class="reference internal" href="json.html">JSON Syntax</a></li>
<li class="toctree-l4"><a class="reference internal" href="sponge-conf.html">global.conf</a></li>
<li class="toctree-l4"><a class="reference internal" href="server-properties.html">server.properties</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../management/index.html">Server Management</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../spongineer/index.html">Becoming an Expert Spongineer</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../preparing/index.html">Preparing for Development</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../plugin/index.html">Creating a Plugin</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../ore/index.html">Ore Documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../contributing/index.html">Contributing to Sponge</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../about/index.html">About the Sponge Project</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="../../../index.html">Sponge</a>
      </nav>


      <div class="wy-nav-content">
        <div class="rst-content">

 

<div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../../../index.html">Docs</a> &raquo;</li>
          <li><a href="../../index.html">Creating a Server</a> &raquo;</li>
          <li><a href="../index.html">Getting Started</a> &raquo;</li>
          <li><a href="index.html">Configuring Sponge</a> &raquo;</li>
    <li>Introduction to HOCON</li>
      <li class="wy-breadcrumbs-aside">
            <a href="https://github.com/SpongePowered/SpongeDocs/blob/minor-fixes-ocd/source/server/getting-started/configuration/hocon.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
  <div class="section" id="introduction-to-hocon">
<h1>Introduction to HOCON<a class="headerlink" href="#introduction-to-hocon" title="Permalink to this headline">¶</a></h1>
<p>HOCON (Human-Optimized Config Object Notation) is an easy-to-use configuration format. It is used by Sponge and
individual plugins utilizing the Sponge API to store important data, such as configuration or player data. HOCON files
typically use the suffix <code class="docutils literal"><span class="pre">.conf</span></code>.</p>
<div class="section" id="components">
<h2>Components<a class="headerlink" href="#components" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>a <code class="docutils literal"><span class="pre">key</span></code> is a string preceding a value</li>
<li>a <code class="docutils literal"><span class="pre">value</span></code> is a string, number, object, array, or boolean following a <code class="docutils literal"><span class="pre">key</span></code></li>
<li>a <code class="docutils literal"><span class="pre">key-value</span> <span class="pre">separator</span></code> separates keys from values, and can be either <code class="docutils literal"><span class="pre">:</span></code> or <code class="docutils literal"><span class="pre">=</span></code></li>
<li>a <code class="docutils literal"><span class="pre">comment</span></code> is prefixed with <code class="docutils literal"><span class="pre">#</span></code> or <code class="docutils literal"><span class="pre">//</span></code>, typically serving to provide feedback or instructions</li>
</ul>
<p><strong>Example:</strong></p>
<div class="highlight-none"><div class="highlight"><pre><span></span>yellow-thing: &quot;Sponge&quot;
</pre></div>
</div>
<p>In this example, the <code class="docutils literal"><span class="pre">key</span></code> is <code class="docutils literal"><span class="pre">yellow-thing</span></code>, the <code class="docutils literal"><span class="pre">value</span></code> is <code class="docutils literal"><span class="pre">Sponge</span></code>, and the <code class="docutils literal"><span class="pre">key-value</span> <span class="pre">separator</span></code> is <code class="docutils literal"><span class="pre">:</span></code>.</p>
</div>
<div class="section" id="working-with-hocon">
<h2>Working with HOCON<a class="headerlink" href="#working-with-hocon" title="Permalink to this headline">¶</a></h2>
<p>HOCON is more flexible than the JSON (JavaScript Object Notation) format in that there are several ways to write valid
HOCON. Below are two examples of valid HOCON.</p>
<p><strong>Example #1:</strong></p>
<div class="highlight-none"><div class="highlight"><pre><span></span>player: {
    name: &quot;Steve&quot;,
    level: 30
}
</pre></div>
</div>
<p><strong>Example #2:</strong></p>
<div class="highlight-none"><div class="highlight"><pre><span></span>player {
    name = &quot;Steve&quot;
    level = 30
}
</pre></div>
</div>
<p>In practice, it is best to follow the formatting conventions of the HOCON configuration you are editing. When editing
a HOCON configuration for Sponge or an individual plugin utilizing the Sponge API, the values are likely the only thing
you will be changing unless otherwise specified.</p>
<div class="section" id="debugging-your-configuration">
<h3>Debugging your configuration<a class="headerlink" href="#debugging-your-configuration" title="Permalink to this headline">¶</a></h3>
<p>If a HOCON configuration does not appear to be working, here are some tips.</p>
<ul class="simple">
<li>Curly braces must be balanced</li>
<li>Quotation marks must be balanced</li>
<li>Duplicate keys that appear later take precedence</li>
</ul>
</div>
</div>
<div class="section" id="specification">
<h2>Specification<a class="headerlink" href="#specification" title="Permalink to this headline">¶</a></h2>
<p>More information about the HOCON format can be found <a class="reference external" href="https://github.com/typesafehub/config/blob/master/HOCON.md">here</a>.</p>
</div>
</div>

           </div>
          </div>
<footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="json.html" class="btn btn-neutral float-right" title="JSON Syntax" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
        <a href="index.html" class="btn btn-neutral" title="Configuring Sponge" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&copy; Copyright 2014-2017, Sponge Contributors.
    </p>
  </div>Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 
</footer>
        </div>
      </div>

    </section>

  </div>


<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
    <span class="rst-current-version" data-toggle="rst-current-version">
        <i class="fa fa-book"> <span>SpongeDocs</span></i>
        v: 6.0.0
        <span class="fa fa-caret-down"></span>
    </span>
    <div id="versions" class="rst-other-versions">




            <dl>
                <dt>Contribute</dt>
                    <dd><a href="https://github.com/SpongePowered/SpongeDocs/blob/minor-fixes-ocd/source/server/getting-started/configuration/hocon.rst">Source</a></dd>
                    <dd><a href="https://github.com/SpongePowered/SpongeDocs/edit/minor-fixes-ocd/source/server/getting-started/configuration/hocon.rst">Edit</a></dd>
            </dl>
    </div>
</div>

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'../../../',
            VERSION:'6.0.0',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true
        };
    </script>      <script type="text/javascript" src="../../../_static/jquery.js"></script>      <script type="text/javascript" src="../../../_static/underscore.js"></script>      <script type="text/javascript" src="../../../_static/doctools.js"></script>      <script type="text/javascript" src="../../../_static/spongedocs.js"></script>

    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
 
</body>
</html>