Getting started
Learn the structure of YACL to understand how it works.
Option.<Boolean>createBuilder() // boolean is the type of option we'll be making
.name(Component.literal("Boolean Option"))
.description(OptionDescription.of(Component.literal("This text will appear as a tooltip when you hover over the option.")))
.binding(
true, // the default value
() -> this.myBooleanOption, // a getter to get the current value from
newVal -> this.myBooleanOption = newVal
)
.controller(TickBoxControllerBuilder::create)
.build()YetAnotherConfigLib.createBuilder()
.title(Component.literal("Used for narration. Could be used to render a title in the future."))
.category(ConfigCategory.createBuilder()
.name(Component.literal("Name of the category"))
.tooltip(Component.literal("This text will appear as a tooltip when you hover or focus the button with Tab. There is no need to add \n to wrap as YACL will do it for you."))
.group(OptionGroup.createBuilder()
.name(Component.literal("Name of the group"))
.description(OptionDescription.of(Component.literal("This text will appear when you hover over the name or focus on the collapse button with Tab.")))
.option(Option.<Boolean>createBuilder()
.name(Component.literal("Boolean Option"))
.description(OptionDescription.of(Component.literal("This text will appear as a tooltip when you hover over the option.")))
.binding(true, () -> this.myBooleanOption, newVal -> this.myBooleanOption = newVal)
.controller(TickBoxControllerBuilder::create)
.build())
.build())
.build())
.build()
Displaying the GUI
Mod Menu (Fabric)
Adding the dependency
Using the API
Registering the entrypoint
NeoForge Mod List
Last updated