Skip to content

Event docs (5 events now)#65

Open
denisJaved wants to merge 8 commits intoKubeJS-Mods:mainfrom
StoryAnvil:main
Open

Event docs (5 events now)#65
denisJaved wants to merge 8 commits intoKubeJS-Mods:mainfrom
StoryAnvil:main

Conversation

@denisJaved
Copy link

@denisJaved denisJaved commented Apr 26, 2025

Planning to documented some events. Will mark PR as ready for review when I will finish probably at least 5 events.

Already documented:

  • BlockEvents.placed
  • ClientEvents.leftDebugInfo
  • ClientEvents.rightDebugInfo
  • ServerEvents.basicCommand (modified for consistancy)
  • ServerEvents.tags

Tip

You can view all the changes even before PR is merged by visiting https://kubejs.com/wiki/preview/65

@denisJaved denisJaved marked this pull request as ready for review April 26, 2025 07:32
@denisJaved denisJaved changed the title Event docs Event docs (5 events now) Apr 26, 2025
@undeadf0x
Copy link

Would you mind if I use your pages in a pull request? I figure there's no use in redoing what's already been done

@RenPT23
Copy link

RenPT23 commented Sep 20, 2025

well does somebody know how to use ServerEvents.tick?

Code above will add text `I love KUBEJSSS` in bottom of left side in F3 screen.

>>> info
`event.getLines()` returns javascript array. You can find information about them at [MDN docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slight inacurracy - It's actually a Java List of Strings, but Rhino makes it so that the integration between Java and JS is almost seamless - JS treats the List like a JS array (can be indexed like one), but keep in mind it isn't exactly a JS array - it's handled a bit differently.

https://github.com/KubeJS-Mods/KubeJS/blob/99655ced4fbb3627ed5d2a50745cc525a4161c7c/src/main/java/dev/latvian/mods/kubejs/client/DebugInfoKubeEvent.java#L26

})
```

`<regestry>` can be any of registries even modded ones! For modded registries you must include namespace.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here, it should be <registry>

@KonSola5 KonSola5 mentioned this pull request Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants