How to create sword's keybinded abilities?

Started by Maslek on Wed, 11/24/2021 - 13:35

Topic category: Help with modding (Java Edition)

Last seen on 18:02, 26. Nov 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to create sword's keybinded abilities?
Wed, 11/24/2021 - 13:35

I am going to create a mode with tons of swords and melee weapons and im looking for to make them a keybinded ability or even two.
I tried taking a look on procedures but they don't seem to have keybinding stuff.
Any advice on it?

Last seen on 14:55, 26. Nov 2021
Joined May 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Make a "Key binding" element…
Wed, 11/24/2021 - 18:20

Make a "Key binding" element, choose the key to press while holding a specific weapon, and then for the "On key pressed" procedure, use the structure shown in the screenshot. https://imgur.com/a/yJr1zPB

Have a great day!

Last seen on 10:22, 30. Nov 2021
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How will you able to make it…
Wed, 11/24/2021 - 21:17

How will you able to make it have multiple abilities.

Let's say if I press the keybind it will set the first skill Then I need to right click to activate that skill, if I press the keybind a second time it set to the 2nd skill and so on

Last seen on 14:55, 26. Nov 2021
Joined May 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
First, make a global…
Thu, 11/25/2021 - 02:56

First, make a global variable.

Second, make a keybind with this procedure for when button pressed.

FInally, make the item/tool/whatever with this procedure for when right-clicked in air.

 

It wont let me put three image links in one post, so I'll put them in their own separate replies.

Last seen on 10:22, 30. Nov 2021
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thanks I've been looking for…
Thu, 11/25/2021 - 08:54

Thanks I've been looking for this. Who knew it would that simple, thanks 😊

Last seen on 18:02, 26. Nov 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Humongous thanks good sir!…
Thu, 11/25/2021 - 17:31

Humongous thanks good sir! However I find the ability a bit challenging.
I'll set the entire ability and how I want to make it really simple.
On pressing the key with the item in hand the space infront of the player will be struck with lightining and 3 blocks ahead with it (so 3 blocks infront of the player will be thunderstruck) 
I just don't really get how to "explain" to the program how to strike exactly the 3 blocks infront of the player and not exact coordinates or random direction instead of front.
Sorry if it takes your time, I'll be really happy if you did it.

Last seen on 14:55, 26. Nov 2021
Joined May 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
To ClOud1076, you're welcome…
Thu, 11/25/2021 - 19:21

To ClOud1076, you're welcome. To Maslek, all you have to do is grab a [Strike lightning at x: y: z: effect only:] block from "World management," grab two "Look position with raytrace distance" blocks, one for X and one for Z, and replace the X and Z blocks in the strike lightning block with these look raytrace ones. You can do the same for the Y block, but that just affects how high/low the lightning spawns, and it is completely optional. Here's a screenshot. https://imgur.com/CAs19QZ