
Что это
Sided reloadable native event for KubeJS
- Тип: мод
- Загрузчик: forge
- Версии Minecraft: 1.16.5 – 1.20.1
- Скачиваний на Modrinth: 39 556
Подробно
is a KubeJS addon that adds reloadable native events for KubeJS.
refresh your native event listeners without restarting the whole game or store the handler within a global['someId'], which is both simpler and more performant. add/remove native event listeners as you like without relaunching, which was impossible in KubeJS for 1.16-1.20 prevent your game from crashing if something goes wrong in your native event listener add event listener only in server/client side
By default, EventJS will replace the original native event listening method to make it reloadable. So you actually don't need to learn anything new in order to use EventJS, just install it and you Forge event listening is reloadable now.
But, if you're looking for some more dynamic and well-defined event listending, you can use NativeEvents.onEvent(...), and NativeEvents.onGenericEvent(...) for generic event listening.
NativeEvents will be avaliable for all 3 script types (client/server/startup), so you can perform sided event listening, that is, for example, listen to client-only event in clientscripts, then this event listening will not happen on server side.
js NativeEvents.onEvent(eventType, handler) NativeEvents.onEvent(priority, receiveCancelled, eventType, handler) NativeEvents.onGenericEvent(genericClassFilter, eventType, handler) NativeEvents.onGenericEvent(genericClassFilter, priority, receiveCancelled, eventType, handler)
The handler in JS side, is a callback that receives the event, for example: (event) => {...}
The eventType and genericClassType is something that can represent a class, like a string that holds the event class name, or the event class itself loaded by java(...) or Java.loadClass(...).
typescript let handler: (event: AnyForgeEvent) => void let eventType: string | Class let genericClassFilter: string | Class let priority: $EventPriority | "highest" | "high" | "normal" | "low" | "lowest" let receiveCancelled: boolean
In EventJS 1.4.0, in order to support ProbeJS Legacy out of the box, the eventType and genericClassFilter will only actively support Class loaded via java(...) (1.16.5) or Java.loadClass(...) (1.20.1).
typescript let eventType: Class let genericClassFilter: Class
1.2.0: all major version between 1.16 and 1.20
The reason why I make this mod is that KubeJS is absurdly slow in implementing similar features. They added native event listener reloading only after KubeJS updated to 1
Как установить
Скачайте файл на официальной странице ниже и положите его в папку mods (для модов) или plugins (для плагинов) вашего сервера или клиента. Для модов нужен совместимый загрузчик. Версия должна совпадать с версией Minecraft.
Текст подготовлен автоматически из описания на Modrinth и ждёт проверки редакцией.
Комментарии 0
Комментарии к этому материалу отключены.
Читайте также
Smithing Upgradeable Tools
Make some tools upgradables in the smithing table 05.12.2026
Persistent Mining
Saves block breaking progress so you can continue mining later. 05.12.2026
EnderiumOre
Enderium is a new ore for the end, just as the nether has netherite now the end has Enderium 05.12.2026
Abyssal Shop
This Is A Simple Plugin With A Currency And Shop, Auction House, Sell, Gamble, And Operator Commands Such As /givemoney /setmoney… 05.12.2026
Bed Icons
combines the old bed icons with the new model in one pack 05.12.2026
Depiglining
Reverts speedrunning nerfs from 1.16.2+ like Piglin Brutes and bartering 05.12.2026