Disabling offhand slot

Started by Horizon354 on

Topic category: Help with MCreator software

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Disabling offhand slot

I am making a mod that has more weapons, some of which are “two handed” and disable the offhand slot. My goal for theses is that the weapon is in the hand (triggers via the weapon trigger ”when in hand tick”). It saves the item in the offhand slot via player persistent variables, and then switches the offhand to an air block. However, what I’m struggling with is returning the saved item after the weapon is gone. I tried waiting a few ticks and then returning the item, but that just made it flahed in and out of the offhand slot, so instead I tried to make it wait a few ticks and then check again if the offhand is a tag “two handed weapons”, but then it just wouldn’t return the item at all. Any solutions?

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nevermind, I figured it out…
Sat, 01/28/2023 - 02:24

Nevermind, I figured it out. It was checking the empty itemstack again after it had already been cleared so it returned an empty itemstack.

Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi! I'm also trying to make…
Tue, 02/07/2023 - 16:24

Hi! I'm also trying to make a two-handed weapon and I can't block off-hand.
Can you share your procedure?

Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What you could also do …
Fri, 08/11/2023 - 02:02

What you could also do (though the item in the offhand is still visible) is while the weapon is in the main hand, you can set the item in the offhand on cooldown