Перейти к содержимому
Mineforgian

Notify

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

Загрузки
1K
Подписчики
6
Обновлён
2 марта 2024 г.
Лицензия
MIT

Опубликован 7 апреля 2023 г.

🔔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

Ченджлог

1.3.0Релиз1.20.2, 1.20.3, 1.20.4 · 2 марта 2024 г.
1.2.4Релиз1.20.2, 1.20.3, 1.20.4 · 28 декабря 2023 г.
  • fix MouseButtonEven
1.1.3Релиз1.19.2, 1.19.3, 1.19.4 · 12 июня 2023 г.
  • add ProjectileHitEvent
1.1.2Релиз1.19.2, 1.19.3, 1.19.4 · 3 июня 2023 г.
  • add PlayerEvent, EntityEvent interfaces
  • remove PlayerDamageEvent
  • improve PlayerSlotClickedEvent
  • add craft item, interact block events
  • add EntitySpawnEvent
1.0.6Релиз1.19.2, 1.19.3, 1.19.4 · 18 мая 2023 г.
  • allow removing join and quit messages
1.0.5Релиз1.19.2, 1.19.3, 1.19.4 · 12 мая 2023 г.
  • fix PlayerJoinEvent, PlayerQuitEvent join/quit message modification
  • add EntityDamageEvent

Комментарии

Загружаем…