5zig / The-5zig-API

The official client API of The 5zig Mod.
Apache License 2.0
11 stars 2 forks source link

How can I make module items render more frequently? #9

Closed ghost closed 7 years ago

5zig commented 7 years ago

What exactly do you mean?

ghost commented 7 years ago

Oh sorry.

Well, I set up a module item that colors different words on keypresses, but from the keypress to being rendered takes time, and it will sometimes skip a couple "frames" because i can press the key several times before it gets rendered again.

5zig commented 7 years ago

That usually should not be the case. The module items get rendered every frame. Maybe try using Keyboard.isKeyDown() in your render method instead.

ghost commented 7 years ago

I'm currently listening to onWorldTick and just checking if the keybinding is pressed.

How do I use Keyboard.isKeyDown() instead?

5zig commented 7 years ago

Call Keyboard.isKeyDown(Keyboard.KEY_J) in the render method of your module item to check every frame if the J key is currently pressed.