Piko

Effortlessly manage events in your Kotlin-based application with Piko, a lightweight and flexible event management library. Simplify the process of registering listeners and triggering events with ease.


Piko is specifically designed for Kotlin and works best when used with Kotlin’s coding style. It’s strongly recommended to use it exclusively with Kotlin.

Key Features

  • Lightweight Framework: Provides a streamlined framework for managing events and listeners.

  • Intuitive API: Offers an easy-to-use API for registering and triggering events.

  • Reduced Boilerplate: Minimizes boilerplate code by centralizing event management.

  • Maintainable Logic: Organizes listeners clearly to keep logic maintainable and easy to track.

Installation

Maven Central


Maven Central Version

Make sure to replace ${version} with the latest version of Piko!

Gradle (Kotlin DSL)

repositories {
mavenCentral()
}

dependencies {
implementation("dev.lyzev.api:piko:${version}")
}

Gradle (Version Catalog)

[versions]
piko = "${version}"

[libraries]
piko = { module = "dev.lyzev.api:piko", version.ref = "piko" }

Gradle (Groovy DSL)

repositories {
mavenCentral()
}

dependencies {
implementation 'dev.lyzev.api:piko:${version}'
}

Maven

<dependencies>
<dependency>
<groupId>dev.lyzev.api</groupId>
<artifactId>piko</artifactId>
<version>${version}</version>
</dependency>
</dependencies>

Raw JAR

  1. Visit the Maven Central Repository and download the JAR file for the version you need.

  2. Add the downloaded JAR to your project.

Usage

Event Listener Example

Below is a simple example demonstrating how to implement an event listener in Piko:

import dev.lyzev.api.event.EventListener
import dev.lyzev.api.event.on

class TestEventListener : EventListener {

var handle = true

init {
on<TestEvent>(Event.Priority.HIGH) { event ->
if (event.a == 5)
event.isCancelled = true
println("TestEvent: ${event.a}")
}
}

override val shouldHandleEvents
get() = handle
}

Event Example

Below is an example demonstrating how to create an event in Piko:

import dev.lyzev.api.event.CancellableEvent

class TestEvent(val a: Int) : CancellableEvent()

Bugs and Suggestions

GitHub Issues

For bugs or suggestions, please submit them via the GitHub Issue Tracker. Be sure to use the provided templates and include all relevant details to help us understand your issue and resolve it swiftly. Your cooperation is greatly appreciated!

GitHub Issues

Discord Community

Need assistance or have minor questions? Join our welcoming community on the Discord server. Our members and staff are always ready to help!

Discord Server

Contribution

We welcome contributions from the community! Please read our Contribution Guidelines to get started.

Pull Requests

Security Policy

Please review our Security Policy to understand how we handle security vulnerabilities.


Please do not publicly disclose the vulnerability until it has been fixed.

License

Copyright (C) 2025 Lyzev

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/agpl-3.0.en.html.

Packages

Link copied to clipboard

The dev.lyzev.api.event package is a core component of the Piko event management library. It provides the necessary interfaces and classes to create, register, and manage events and event listeners.