{"id":65959,"date":"2026-06-03T21:57:01","date_gmt":"2026-06-03T18:57:01","guid":{"rendered":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/"},"modified":"2026-06-03T21:57:01","modified_gmt":"2026-06-03T18:57:01","slug":"eventjs","status":"publish","type":"mod","link":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/","title":{"rendered":"EventJS"},"content":{"rendered":"<p># EventJS<\/p>\n<p>is a KubeJS addon that adds reloadable native events for KubeJS.<\/p>\n<p>With EventJS, you can<\/p>\n<p>*   refresh your native event listeners without restarting the whole game or store the handler within a `global[&#8216;someId&#8217;]`, which is both simpler and more performant.<br \/>\n*   add\/remove native event listeners as you like without relaunching, which was impossible in KubeJS for 1.16-1.20<br \/>\n*   prevent your game from crashing if something goes wrong in your native event listener<br \/>\n*   add event listener only in server\/client side<\/p>\n<p>## Usage<\/p>\n<p>By default, EventJS will replace the original native event listening method to make it reloadable. So you actually don&#8217;t need to learn anything new in order to use EventJS, just install it and you Forge event listening is reloadable now.<\/p>\n<p>But, if you&#8217;re looking for some more dynamic and well-defined event listending, you can use `NativeEvents.onEvent(&#8230;)`, and `NativeEvents.onGenericEvent(&#8230;)` for generic event listening.<\/p>\n<p>`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 `client_scripts`, then this event listening will not happen on server side.<\/p>\n<p>### Syntax (v1.0.0~1.3.0)<\/p>\n<p>&#8220;`js<br \/>\nNativeEvents.onEvent(eventType, handler)<br \/>\nNativeEvents.onEvent(priority, receiveCancelled, eventType, handler)<br \/>\nNativeEvents.onGenericEvent(genericClassFilter, eventType, handler)<br \/>\nNativeEvents.onGenericEvent(genericClassFilter, priority, receiveCancelled, eventType, handler)<br \/>\n&#8220;`<\/p>\n<p>The `handler` in JS side, is a callback that receives the event, for example: `(event) => {&#8230;}`<\/p>\n<p>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(&#8230;)` or `Java.loadClass(&#8230;)`.<\/p>\n<p>&#8220;`typescript<br \/>\nlet handler: (event: AnyForgeEvent) => void<br \/>\nlet eventType: string | Class<br \/>\nlet genericClassFilter: string | Class<br \/>\nlet priority: $EventPriority | &#8220;highest&#8221; | &#8220;high&#8221; | &#8220;normal&#8221; | &#8220;low&#8221; | &#8220;lowest&#8221;<br \/>\nlet receiveCancelled: boolean<br \/>\n&#8220;`<\/p>\n<p>### Changes in 1.4.0<\/p>\n<p>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(&#8230;)` (1.16.5) or `Java.loadClass(&#8230;)` (1.20.1).<\/p>\n<p>&#8220;`typescript<br \/>\nlet eventType: Class<br \/>\nlet genericClassFilter: Class<br \/>\n&#8220;`<\/p>\n<p>## Supported Version<\/p>\n<p>1.0.0: 1.16.5<\/p>\n<p>1.1.0: 1.16.5, 1.20.1<\/p>\n<p>1.2.0: all major version between 1.16 and 1.20<\/p>\n<p>## Do You Know That<\/p>\n<p>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.21, leaving all versions between 1.16~1.20 behind.<\/p>\n<p>KubeJS for 1.21+ also contains support for native event listener reloading, using the same name `NativeEvents`, but its implementation is not the same as EventJS, so please dont make assumptions when interacting EventJS internals via Java.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sided reloadable native event for KubeJS<\/p>\n","protected":false},"featured_media":65960,"template":"","meta":{"_minecraft_slug":"eventjs","_minecraft_project_id":"Pubv5FOl","_minecraft_author":"ZZZank","_minecraft_license":"GPL-3.0-or-later","_minecraft_downloads":33095,"_minecraft_follows":5,"_minecraft_client_side":"required","_minecraft_server_side":"required","_minecraft_storage_type":"zip","_minecraft_archive_name":"eventjs.zip","_minecraft_size_bytes":94611,"_minecraft_version_count":2,"_minecraft_updated_at":"2026-05-16T15:23:42.944553Z","_minecraft_date_created":"2025-05-31T22:42:02.748390Z","_minecraft_date_modified":"2025-05-27T00:51:41.057626Z","_minecraft_project_url":"https:\/\/modrinth.com\/mod\/eventjs","_minecraft_icon_attachment_id":65960,"_minecraft_imported_at":"2026-06-03T18:57:02+00:00","_minecraft_import_hash":"178a3fef8f24f56a9c91405b9a2d8876","_minecraft_versions":"","_minecraft_links":"","_minecraft_gallery":"","_minecraft_api_metadata":""},"mod_category":[104,873,92],"mod_loader":[106],"minecraft_version":[48,36],"class_list":["post-65959","mod","type-mod","status-publish","has-post-thumbnail","hentry","mod_category-forge","mod_category-library","mod_category-utility","mod_loader-forge","minecraft_version-1-16-5","minecraft_version-1-20-1"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>EventJS - Minecraft<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"EventJS - Minecraft\" \/>\n<meta property=\"og:description\" content=\"Sided reloadable native event for KubeJS\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/\" \/>\n<meta property=\"og:site_name\" content=\"Minecraft\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/eventjs\\\/\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/eventjs\\\/\",\"name\":\"EventJS - Minecraft\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/eventjs\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/eventjs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/eventjs-icon-3be92ed9f1bd3e2030579f9c759cec80b07d20ab_96.webp\",\"datePublished\":\"2026-06-03T18:57:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/eventjs\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/eventjs\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/eventjs\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/eventjs-icon-3be92ed9f1bd3e2030579f9c759cec80b07d20ab_96.webp\",\"contentUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/eventjs-icon-3be92ed9f1bd3e2030579f9c759cec80b07d20ab_96.webp\",\"width\":96,\"height\":96},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/eventjs\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mods\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"EventJS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\",\"name\":\"Minecraft\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"EventJS - Minecraft","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/","og_locale":"en_US","og_type":"article","og_title":"EventJS - Minecraft","og_description":"Sided reloadable native event for KubeJS","og_url":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/","og_site_name":"Minecraft","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/","url":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/","name":"EventJS - Minecraft","isPartOf":{"@id":"https:\/\/vpesports.com\/minecraft\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/#primaryimage"},"image":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/#primaryimage"},"thumbnailUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/eventjs-icon-3be92ed9f1bd3e2030579f9c759cec80b07d20ab_96.webp","datePublished":"2026-06-03T18:57:01+00:00","breadcrumb":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/#primaryimage","url":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/eventjs-icon-3be92ed9f1bd3e2030579f9c759cec80b07d20ab_96.webp","contentUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/eventjs-icon-3be92ed9f1bd3e2030579f9c759cec80b07d20ab_96.webp","width":96,"height":96},{"@type":"BreadcrumbList","@id":"https:\/\/vpesports.com\/minecraft\/mods\/eventjs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vpesports.com\/minecraft\/"},{"@type":"ListItem","position":2,"name":"Mods","item":"https:\/\/vpesports.com\/minecraft\/mods\/"},{"@type":"ListItem","position":3,"name":"EventJS"}]},{"@type":"WebSite","@id":"https:\/\/vpesports.com\/minecraft\/#website","url":"https:\/\/vpesports.com\/minecraft\/","name":"Minecraft","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vpesports.com\/minecraft\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod\/65959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod"}],"about":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/types\/mod"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media\/65960"}],"wp:attachment":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media?parent=65959"}],"wp:term":[{"taxonomy":"mod_category","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_category?post=65959"},{"taxonomy":"mod_loader","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_loader?post=65959"},{"taxonomy":"minecraft_version","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/minecraft_version?post=65959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}