Triggers Library
No reviews yet
A modular Forge-style event API for triggers!
Provides a framework or library for other mods to use.
Forge is a popular mod loader for versions 1.1+ of Minecraft.
Neoforge is a fork of the Minecraft Forge available for versions 1.20.1+ of Minecraft. Many Forge mods are compatible with Neoforge and vice versa.
Fabric is a mod loader for versions 1.14+ of Minecraft, particularly popular for client side and optimization mods.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
Triggers
About
Triggers is a library mod that provides a unified, modular, Forge-style event API for in-game triggers and advancement criteria. It abstracts standard Minecraft triggers (such as item enchantment, block interactions, taming animals, and earning stats) into an easy-to-use event bus. This allows developers to seamlessly listen to and handle these actions across multi-loader environments (Forge, Fabric, and NeoForge) without needing to mixin to the triggers themselves.
For Developers
Adding to your build.gradle
You can easily add Triggers to your development environment using the Modrinth Maven.
First, add the Modrinth maven to your repositories block:
repositories {
exclusiveContent {
forRepository {
maven {
url = "" rel="noopener nofollow" target="_blank">https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
}
Then, add the mod as a dependency in your dependencies block:
dependencies {
// Replace <version> with the target version of Triggers
implementation "maven.modrinth:triggers:<version>"
}
Example Usage
Triggers uses a custom event bus that functions similarly to Forge's event bus. You can register listeners to
Triggers.EVENTS and listen for specific events.
import com.evandev.triggers.Triggers;
import com.evandev.triggers.event.events.TriggerEntityEvent;
import com.evandev.triggers.event.events.TriggerPlayerEvent;
public class MyMod {
public static void init() {
// Listen for when a player enchants an item
Triggers.EVENTS.addListener(TriggerPlayerEvent.Enchant.class, event -> {
System.out.println(event.player.getName().getString() + " enchanted " + event.item);
});
// Listen for when an animal is tamed
Triggers.EVENTS.addListener(TriggerEntityEvent.TameAnimal.class, event -> {
if (event.causedByPlayer != null) {
System.out.println("Animal tamed by: " + event.causedByPlayer.getName().getString());
}
});
}
}
License
Triggers
About
Triggers is a library mod that provides a unified, modular, Forge-style event API for in-game triggers and advancement criteria. It abstracts standard Minecraft triggers (such as item enchantment, block interactions, taming animals, and earning stats) into an easy-to-use event bus. This allows developers to seamlessly listen to and handle these actions across multi-loader environments (Forge, Fabric, and NeoForge) without needing to mixin to the triggers themselves.
For Developers
Adding to your build.gradle
You can easily add Triggers to your development environment using the Modrinth Maven.
First, add the Modrinth maven to your repositories block:
repositories {
exclusiveContent {
forRepository {
maven {
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
}
Then, add the mod as a dependency in your dependencies block:
dependencies {
// Replace <version> with the target version of Triggers
implementation "maven.modrinth:triggers:<version>"
}
Example Usage
Triggers uses a custom event bus that functions similarly to Forge's event bus. You can register listeners to
Triggers.EVENTS and listen for specific events.
import com.evandev.triggers.Triggers;
import com.evandev.triggers.event.events.TriggerEntityEvent;
import com.evandev.triggers.event.events.TriggerPlayerEvent;
public class MyMod {
public static void init() {
// Listen for when a player enchants an item
Triggers.EVENTS.addListener(TriggerPlayerEvent.Enchant.class, event -> {
System.out.println(event.player.getName().getString() + " enchanted " + event.item);
});
// Listen for when an animal is tamed
Triggers.EVENTS.addListener(TriggerEntityEvent.TameAnimal.class, event -> {
if (event.causedByPlayer != null) {
System.out.println("Animal tamed by: " + event.causedByPlayer.getName().getString());
}
});
}
}
License
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers