Code to fire a projectile with left click

Started by Spyjetray on Mon, 08/31/2020 - 09:02

Topic category: Help with modding (Java Edition)

Last seen on 16:23, 16. Sep 2020
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Code to fire a projectile with left click
Mon, 08/31/2020 - 09:02

Hi,

I want to make a piece of armour that when you wear it and press left click, it fires a projectile, regardless of what's in your hand.

I'm aware that this can be done with coding with a keypress event but I am clueless when it comes to coding and I can't find any tutorials for what I need.

Can someone write the code I need to make something like this work, or at the very least, link a tutorial on how to make somethiing like this?

Thanks.

Last seen on 07:56, 26. Oct 2020
Joined Jun 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You don't need to code, all…
Tue, 09/01/2020 - 01:21

You don't need to code, all you need to do is use the procedure system within MCreator. Using the "player on left/right click in air" trigger or something, check if the player is wearing the armor, and if so, use the procedure block that launches a projectile.