Скачать Server Events — Minecraft Моды — ModStock

Server Events

Активный

Установок

0

Последнее обновление

2 недели назад

Версии

1.21.5 — 1.21.6
Клиент и сервер
Fabric
Библиотеки

ServerEvents

ServerEvents is a support library for Fabric server development, designed to enhance the Fabric API's limited event system. It offers a Bukkit-like event framework while adhering to Fabric's minimalist philosophy.

The mod doesn't wrap CommandRegistrationCallback and DynamicRegistrySetupCallback from Fabric API.

Installation

  1. Import this package to your project, more information at jitpack.io.
  2. Add serverevents to your mod depends.

Usage

ServerEvents provides a simple API for registering and processing events.

Here is an example of a player modifying broadcast information and giving an apple when joining:

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());
        });
    }
}

License

This project is licensed under the MIT License © 2025 sucj.

Участники проекта
KKW557

KKW557

Разработчик