Procedure for Pickaxe/Tool that has a 50% chance to clone/copy whatever block it destroys in addition to normal drop

Started by Kyriya on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedure for Pickaxe/Tool that has a 50% chance to clone/copy whatever block it destroys in addition to normal drop

Hey all I'm having a bit of an issue trying to make a procedure for my custom Pickaxe tool so that when it "On Block Destroyed With Tool" it has a 50% chance to copy whatever was mined or destroyed/The player was looking at (whatever is easiest to make) and add it to the players inventory.

For Example:

The Player Mines some "Smooth Stone", and with a 50% chance has Smooth Stone added to their inventory as well as have the Cobblestone you'd get normally from destroying it with a pick. The same applies for Coal, you'd get the 1 unit of coal as per a normal pickaxe with a 50% chance to get an unmined Coal Ore Block in your inventory, same for Diamond, Emerald etc..

 

Sadly I am not very good with coding in general and cannot find a way to determine what was destroyed by the pick and then have the 50% chance to copy it to the players inventory. I hope someone could be so kind as to suggest a way to do this, sorry if I have not made myself very clear, but maybe someone can advise a way to do this. Thank you!

 

Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It’s not that hard tho
Wed, 05/26/2021 - 11:01

It’s not that hard tho

Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It’s very simple u shall try
Wed, 05/26/2021 - 11:01

It’s very simple u shall try