?Notify
你是否厌倦了为每个项目重复创建用于相同事件的 mixin?在以前的好日子里,我们只需这样做一次。这就是为什么我们创建了这款出色的库/模组——只需添加一次事件,即可在所有其他项目中使用!
为此,我们使用了 alert,一个极速的事件监听工具。请参阅 alert 的文档 了解如何监听事件。
使用方法
将以下内容添加到你的模组的 build.gradle.kts 文件中:
repositories {
mavenCentral()
}
dependencies {
// ...
modImplementation("de.hglabor:notify:1.1.3")
}
然后将 notify 构建好的 jar 文件放入你的 mods 文件夹中。你应该能够像这样订阅事件:
// (在服务器端)
subscribeToEvent<PlayerJoinEvent> {
logger.info("玩家 ${it.player.name.string} 已加入")
}
当前已实现的事件
客户端的事件订阅尚未测试!(服务器/通用事件 应在服务器上正常工作)
通用
PlayerAttackEntityEventPlayerHungerChangeEventPlayerItemPickupEventPlayerPlaceBlockEventPlayerSlotClickEvent
服务器
PlayerBreakBlockEventPlayerDeathEventPlayerInteractItemEventPlayerInteractBlockEventPlayerItemDropEvent: 当玩家尝试丢弃物品时调用PlayerItemDroppedEvent: 在物品被丢弃后调用PrePlayerJoinEvent: 在玩家加入服务器之前调用PlayerJoinEvent: 当玩家加入服务器时调用。允许修改加入消息PostPlayerJoinEvent: 在玩家加入服务器之后调用PlayerRemoveEvent: 在玩家从玩家列表中移除后调用PlayerQuitEvent: 当玩家离开服务器时调用。允许修改离开消息PlayerSwapHandItemsEventPlayerTickEventPlayerSetSettingsEvent: 例如当玩家更改客户端语言时调用EntitySpawnEventProjectileHitEvent: 当投射物击中另一个实体时调用
客户端
即将推出™更多内容请阅读我们的 GitHub 说明文档
?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
PlayerAttackEntityEventPlayerHungerChangeEventPlayerItemPickupEventPlayerPlaceBlockEventPlayerSlotClickEvent
Server
PlayerBreakBlockEventPlayerDeathEventPlayerInteractItemEventPlayerInteractBlockEventPlayerItemDropEvent: called when a player attempts to drop an itemPlayerItemDroppedEvent: called after an item was droppedPrePlayerJoinEvent: called before a player joins the serverPlayerJoinEvent: called when a player joins the server. Allows modification of the join messagePostPlayerJoinEvent: called after a player joins the serverPlayerRemoveEvent: called after a player got removed from the player listPlayerQuitEvent: called when a player quits the server. Allows modification of the quit messagePlayerSwapHandItemsEventPlayerTickEventPlayerSetSettingsEvent: called e.g. when player changes client languageEntitySpawnEventProjectileHitEvent: called when a projectile hits another entity
Client
soon™For more, read our github readme
下载 Notify
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Notify
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Notify
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Notify
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Notify
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Notify
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Notify
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
评论 0
登录后参与评分
还没有评论,来抢沙发吧