Started by
AlexelierArtist
on
Topic category: Help with Minecraft modding (Java Edition)
I want to make The Binding of Isaac mc mod and I just have one problem
I dont want to make it that you need to click every time to shoot but to make it just on holding the key down.
I was thinking to try make a timer that would shoot on every time it ends, but I have no idea how to, and the key bind have only the option "on key pressed"
Does someone know how could I do it?
Try using nbt numbers
Use a keybind/trigger to set a logic variable or saved NBT data of some kind to true when pressed, and false when released. On player tick, make another number variable or NBT value of the same type saved to the same thing. Variable can be any kind, NBT data can be on anything
This can be replicated using procedures rather easily, and is one of the best ways to do on on tick loops. For blocks, this kind of tick loop works the best for blocks as blocks can set their tickrate, or even use a random tick rate, giving you a little more control over it. You can also use this to make a random tick rate for things other than blocks by changing this around a little.