How do i get an item from right clicking a custom block with an custom item

Started by Akeamw on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do i get an item from right clicking a custom block with an custom item

How do i get an item from right clicking a custom block with an custom item? 

I looked at so many  other posts and i couldn't find an answer...

 

+Pls tell me how to make it and where to look, because i have worse navigation skills than zoro...

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Within the block tab,…
Tue, 05/05/2026 - 20:12

Within the block tab, triggers, on block right clicked. Create a procedure:

(The action result part dictates the players arm swinging when right clicking the block)

If you want the original item to be retained then add it/them back to the inventory after and check for how many there were.

If  [item in main hand] = custom_item
      Set item in main hand to:
                       [custom_item_2]
      
      Return action result type PASS
      
Return action result type FAIL
Joined May 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What does that mean???
Wed, 05/06/2026 - 15:45

What does that mean???

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you search for the code I…
Wed, 05/06/2026 - 21:21

If you search for the code I put up there you will find the procedure blocks that I am referring to.