Skip to content

Deftu-Archive/IncrieMC

Repository files navigation

Incrie

Core utilities and APIs for Minecraft modding.
Report a bug · Request a feature · Wiki · Documentation

Summary

Examples

Examples

Notifications

Java

package com.example;

import net.fabricmc.api.ClientModInitializer;
import xyz.incrie.api.Incrie;
import xyz.incrie.api.gui.notifications.NotificationAlignment;

public class ExampleMod implements ClientModInitializer {
    public void onInitializeClient() {
        Incrie.enqueuePostInitializationOperation(() -> {
            Incrie.getNotifications().post(
                    "Title",
                    "Description",
                    NotificationAlignment.BOTTOM_RIGHT,
                    IncrieTheme.DEFAULT,
                    notification -> {
                        System.out.println("The example notification was clicked! (" + notification + ")");
                    }
            );
        });
    }
}

Kotlin

package com.example

import net.fabricmc.api.ClientModInitializer
import xyz.incrie.api.Incrie
import xyz.incrie.api.gui.notifications.NotificationAlignment

class ExampleMod : ClientModInitializer {
    override fun onInitializeClient() {
        Incrie.enqueuePostInitializationOperation {
            Incrie.getNotifications().post(
                "Title",
                "Description",
                NotificationAlignment.BOTTOM_RIGHT,
                IncrieTheme.DEFAULT
            ) {
                println("The example notification was clicked! ($it)")
            }
        }
    }
}

About

The ultimate Minecraft modding library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published