HELP! Right clicking on entity with specific item!

Started by taj500 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
HELP! Right clicking on entity with specific item!

Im not sure where im messing up here.... but i really need help! How do i make it to where an entity that gives the player an item when they right click an entity with a specific item in hand?   (My blocks)  https://imgur.com/a/TIeD7h6

Joined May 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Now I could be stupid, but…
Sat, 07/18/2020 - 03:24

Now I could be stupid, but it would seem you don't have any item set for what needs to be in-hand. Outside of this, I think your issue it the 'While' loop, as you need to set a condition on that and it will loop until that condition isn't met. I'm fairly certain that the While loop is entirely unneeded and you should be able to get rid of it completely and it'll work, since for the player to get the item cleared they'd need to receive an item and have it in their hand, established in the If statement.

Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
LOL 'add -1' ?? dude use…
Sat, 07/18/2020 - 06:24

LOL 'add -1' ?? dude use REMOVE 1 :D and do not use While on that procedure...

Just Delete the While and the Add -1 part and put 'Remove 1 Item...' on its place, thats it, each time you click on entity with Item A it will give you Item B.

Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
and remove 1 Item A  
Sat, 07/18/2020 - 06:24

and remove 1 Item A