跳到正文

Notify

作者:Krxwallo

You don't want to create mixins for each project over and over again for the same events.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

🔔Notify

You don’t want to create mixins for each project over and over again for the same events you could just use in the good old paper days.
This is why we created this spectacular library/mod, where we just have to add the events once and can use them in every other project!

For this we use alert, a blazing fast event listening utility.
See alert’s documentation on how to listen to events.

How to use

Add the following to your mod’s build.gradle.kts file:

repositories {
    mavenCentral()
}

dependencies {
    // ...
    
    modImplementation("de.hglabor:notify:1.1.3")
}

Then put the built jar file of notify into your mods folder. You should be able to subscribe to the events like this:

// (On the server)
subscribeToEvent<PlayerJoinEvent> {
    logger.info("Player ${it.player.name.string} joined")
}

Events currently implemented

Subscribing to events on the client is not tested! (server/common events should work on the server)

Common
  • PlayerAttackEntityEvent
  • PlayerHungerChangeEvent
  • PlayerItemPickupEvent
  • PlayerPlaceBlockEvent
  • PlayerSlotClickEvent
Server
  • PlayerBreakBlockEvent
  • PlayerDeathEvent
  • PlayerInteractItemEvent
  • PlayerInteractBlockEvent
  • PlayerItemDropEvent: called _when_ a player attempts to drop an item
  • PlayerItemDroppedEvent: called _after_ an item was dropped
  • PrePlayerJoinEvent: called _before_ a player joins the server
  • PlayerJoinEvent: called _when_ a player joins the server. Allows modification of the join message
  • PostPlayerJoinEvent: called _after_ a player joins the server
  • PlayerRemoveEvent: called _after_ a player got removed from the player list
  • PlayerQuitEvent: called _when_ a player quits the server. Allows modification of the quit message
  • PlayerSwapHandItemsEvent
  • PlayerTickEvent
  • PlayerSetSettingsEvent: called e.g. when player changes client language
  • EntitySpawnEvent
  • ProjectileHitEvent: called when a projectile hits another entity
Client

soon™

For more, read our github readme

常见问题

Notify 支持哪些 Minecraft 版本?

Notify 支持 Minecraft Java 版 1.19–1.20.4,共 10 个版本,可用的加载器:Fabric / Quilt。下载时注意选择和你游戏版本一致的文件。

Notify 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Quilt,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。

评论

登录后评论和评分

Krxwallo 的其他作品

查看全部 →