Stop the player from using an item in the secondary hand if another item is already in their hand

Started by JPZamps on

Topic category: Help with modding (Java Edition)

Last seen on 15:41, 28. Mar 2024
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Stop the player from using an item in the secondary hand if another item is already in their hand

I have an item that works as a kind of backpack, it must be left in the secondary hand of the player to work, the problem is that other items that use the right button to attack keep opening the other item's GUI, normally this is already avoided by game as you are using a bow or something, but when both objects are ''items'' the player does the functionality of both, is there any way to prevent this from happening? because it is very annoying every time you attack with an item a GUI appears

Last seen on 15:41, 28. Mar 2024
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry to bother you but…
Tue, 05/17/2022 - 20:01

Sorry to bother you but could you be a little more specific? I didn't understand very well

Last seen on 01:18, 28. Mar 2024
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Create a Item Tag and…
Thu, 05/19/2022 - 18:48

Create a Item Tag and populate it with the items you want to use while your item is in off-hand.

Example: My tag has: Bow, Crossbow, Trident, Ender pearl etc.

Then create your procedure like so

help

Note: For bows / crossbows there must be a Arrow in the inventory to prevent the bag from opening.

Last seen on 15:41, 28. Mar 2024
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey seshua thank you for the…
Fri, 05/20/2022 - 18:44

Hey seshua thank you for the reply, I tested the procedures you sent, but something still seems to be wrong, I don't know exactly what, but it's still not working :/Procedures

Procedures

in game photo
With you could help me here are some photos