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 Minecraft modding (Java Edition)

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

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

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.

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