how to set up shooting conditions?

Started by WelonTrees on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 years ago
Joined Jan 2021
Points:
615

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 13
how to set up shooting conditions?

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.

Active 2 years ago
Joined Jan 2021
Points:
615

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 13
I watched the video. Where…
Tue, 01/05/2021 - 12:27

I watched the video. Where can I find additional terms? In plugins? Or are they already in MCreator?

 

Any block that returns logic…
Tue, 01/05/2021 - 15:20

Any block that returns logic value can be a condition, or combination of them.

Active 2 years ago
Joined Jan 2021
Points:
615

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 13
I cannot find a block that…
Wed, 01/06/2021 - 23:33

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.

Active 2 years ago
Joined Jan 2021
Points:
615

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 13
Block that returns logic…
Thu, 01/07/2021 - 21:55

Block that returns logic value*

Active 7 months ago
Joined Feb 2016
Points:
819

User statistics:

  • Modifications: 0
  • Forum topics: 9
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 127
Klemen means that you can…
Sun, 09/25/2022 - 00:01

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