Skip to content

Creating a config

Olafcio1 edited this page Oct 18, 2026 · 1 revision

This guide assumes you've already created and setup an Avoid project.


§ Making a config with the Avoid Framework


  1. Create a java class;
    You can pick any location within your project source code directory.

  2. Paste the following code:

    package com.example.avoidtmpl;
    
    import pl.olafcio.avoid.mods.annotation_processor.AutoConfig;
    import pl.olafcio.avoid.mods.annotation_processor.AutoFilename;
    import pl.olafcio.avoid.net.config.AutoConfiguration;
    import pl.olafcio.avoid.net.config.annotations.Nested;
    import pl.olafcio.avoid.net.config.annotations.YAML;
    
    @AutoConfig
    @AutoFilename
    
    public class Config implements AutoConfiguration {
      @YAML(comment = "Your comment!", multiline = true)
      String tuff = "123";
    
      @Nested
      Services services = new Services();
    
      class Services {
         @YAML
         String block = "123";
      }
    }

    Of course you need to replace the class name and package.

  3. Customize it as you wish;

    @YAML means this field is a config property (configurations are stored with .yml),
    @Nested means this field's type also contains config properties.

    I think it's pretty self-explanatory.


Avoid Framework


    🏚️ 1. Home
    📽️ 2. Creating your mod
    🌄 3. Adding assets to your mod
    🧊 4. Creating a block
    💧 5. Creating a fluid
    ✏️ 6. Creating an item
    🎯 7. Creating an entity selector
    🤖 8. Creating a command
    ⌨️ 9. Creating a keybind
    🐺 10. Creating an entity
    🌫️ 11. Creating a fog
    🔩 12. Creating an item component
    🔮 13. Creating an effect
    📚 14. Language support & adding libraries
    🚩 15. Deprecation rules
    ⏳ 16. Loading philosophy
    🔀 17. Adding mixins
    🌀 18. Creating a subloader
    ⚙️ 19. Creating a config


Migrations


    🧳 v1.25 -> v1.26
    🧳 v1.26 -> v1.27
    🧳 v1.27 -> v1.28

Clone this wiki locally