Disabling offhand slot

Started by Horizon354 on Tue, 01/24/2023 - 13:20

Topic category: Help with MCreator software

Last seen on 22:03, 13. Mar 2023
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Disabling offhand slot
Tue, 01/24/2023 - 13:20

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?

Last seen on 22:03, 13. Mar 2023
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.

Last seen on 09:31, 19. Mar 2023
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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?