Started by
WelonTrees
on
Topic category: Help with Minecraft modding (Java Edition)
I make a mod. I need to create conditions for shooting so that my pistol does not fire under certain conditions. I don't know what procedures are responsible for the shooting conditions.This is where I need help.
I suggest checking https://www.youtube.com/watch?v=dO8G2CmZk9o&list=PLAeL-oIFIEngf6S4p5X5C… to get started with additional conditions that are used by ranged items too
I watched the video. Where can I find additional terms? In plugins? Or are they already in MCreator?
Any block that returns logic value can be a condition, or combination of them.
I cannot find a block that returns a boolean and is responsible for shooting a ranged object. Of course there is one block, but it does not return a boolean value.
Block that returns logic value*
Klemen means that you can set up your own conditions if you make a procedure and return true/false on it, then you can call it elsewhere and it will work as a condition. For example you can create a procedure that checks for full diamond armor, and then call that in another procedure like:
if (playerHasDiamondArmor == true) {
//Do stuff
}
you can add for example a variable or an nbt tag to your player and use it as cooldown, so if the variable is 0 for example, allows shooting. The variable will be set to like 100 whenever you shoot, and make a procedure that decreases it by 1 every player tick for example, you now have a working cooldown for your gun. Hope it helps