Download Server Events — Minecraft Mods — MetaMods

Server Events

Active

Downloads

0

Last update

1 month ago

Versions

1.21.5 — 1.21.8
Server
Fabric
Libraries

ServerEvents

ServerEvents is a support library for Fabric server development that significantly extends the capabilities of the standard Fabric API event system. The module provides a convenient event handling framework similar to the Bukkit approach, while maintaining Fabric's minimalist philosophy.

A key feature is that the mod does not duplicate the functionality of CommandRegistrationCallback and DynamicRegistrySetupCallback from the standard Fabric API.

Usage Example

Installation

  1. Add the package to your project using the jitpack.io service
  2. Specify dependency on serverevents in your mod's configuration file

Practical Application

ServerEvents offers an intuitive interface for registering and processing various game events.

Here is an example implementation where a player's welcome message is modified and an apple is given upon joining the server:

import net.fabricmc.api.ModInitializer;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Items;
import icu.suc.mc.serverevents.ServerEvents;

public class ExampleMod implements ModInitializer {
    @Override
    public void onInitialize() {
        ServerEvents.Player.MODIFY_JOIN_MESSAGE.register((player, message) -> {
            player.getInventory().add(Items.APPLE.getDefaultInstance());
            return Component.literal("[+] ").append(player.getName());
        });
    }
}
// Comment: player join event handler

Additional Information:

  • Detailed API technical documentation is available
  • Various types of server events are supported
  • Integration with the existing Fabric ecosystem
Project members
KKW557

KKW557

Developer

Created: 18 May 2025

ID: 100411