How do I make Dual-wield weapons?

Started by Bo-Katan22 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make Dual-wield weapons?

I'd like to make it so that if you're holding 2 daggers, one in each hand, they both work and do damage together. 

Unfortunatly I can't use plugins, so if there's another way I'd really like to find out.

Thanks!

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sort of!  Minecraft doesn't…
Thu, 11/02/2023 - 02:41

Sort of! 

Minecraft doesn't normally like letting you use stuff in the off hand while there's something in their main hand. ...However, if you're willing to brute force it, you can make a procedure with the 'before entity is hurt' trigger, and check if the item in the source entity's off hand is your dagger. (Or if you want it to only be dual wielded with another dagger, checks if the item in their off hand and the item in their main hand are both daggers.) 

If it is, you can then just deal damage equal to the item's attack power to the event/target entity. (And probably also remember to deal durability damage to the item in the source entity's off hand.) There's even a function to swing the source-entity's off-hand to make it appear like they're attacking with it, even if it's technically just running the attack through the main hand. 

Hope that helps!

Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you very much! I'll…
Thu, 11/02/2023 - 12:38

Thank you very much! I'll try it out.