How do I detect with which pickaxe the player is breaking the block?

Started by Simonin on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I detect with which pickaxe the player is breaking the block?

 

I am creating a great mod I would say but, I created a ore that gives you a random mineral, this block can only be broken by the iron peak onwards, I did a procedure to make when you break the block you get a random mineral, and I put it into action when the player breaks the block, here goes the problem, if the player breaks it with a stone or wood pickaxe even then gives him the minerals, then I want to know if it can be detected with which pickaxe the player broke the block

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Add at the start of the…
Tue, 09/24/2019 - 08:54

Add at the start of the procedure if item in entity's main hand = iron pickaxe
Then put your procedure inside that.

Joined Apr 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you very much!
Tue, 09/24/2019 - 17:35

Thank you very much!