Attempting to change tool to another tool in main-hand when right-clicked

Started by screwb0y on

Topic category: Help with modding (Java Edition)

Last seen on 17:08, 28. Mar 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Attempting to change tool to another tool in main-hand when right-clicked

Howdy. I'm pretty new at modding/coding, so apologies if this is easy to fix, but I cannot for the life of me figure out what's wrong with this procedure. I've looked it up, and apparently having multiple textures for different instances isn't possible in current MCreator, so instead I'm opting to make a procedure that switches a tool for another tool when right clicked.

 

I'm attempting to make it so that when the clean blade (Rite Blade) is right clicked in your main hand, it damages you and then it becomes bloodied (Used Rite Blade). The sound plays, you get damaged, and the Rite Blade disappears from the inventory, but for some reason it doesn't replace it with a Used Rite Blade. Furthermore, it seems to only ever work properly in creative mode, and it only works in survival when there are other Used Rite Blades in your inventory. Also, another little weird quirk that happens is that the sound sometimes seems to play multiple times at once when right clicked.

 

I'm stumped. Any help?

Last seen on 08:13, 15. Apr 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
by looking at this, the only…
Mon, 03/25/2024 - 15:45

by looking at this, the only thing i can think of, is that "Set item in main-hand of" changes it to a item in your inventory, instead of adding it, most likely a way to fix this, like adding it to your inventory (however that is possible) then changing it, but im not quite sure

Last seen on 08:13, 15. Apr 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thats weird, this works for…
Tue, 03/26/2024 - 17:23

thats weird, this works for me?