Fortune Procedure

Started by pomarf on

Topic category: User side tutorials

Joined Mar 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Fortune Procedure
Thu, 08/29/2019 - 10:28 (edited)

So I've seen a few posts asking how to do fortune on custom ores, and I, myself was even asking a few days ago, but I figured it out and I figured I would make a sort of "mini-tutorial" on how to do it. So here we go.

First, after you've got your custom ore block, and the item that it drops, made go into your block file and go to the procedures tab.
Once there click on the new procedure button under the "When block destroyed by player" option.Block Procedures Tab

 

After you've got your new procedure open, you may want to add the option for the ore to drop xp, as I have done here, but after that you just want to basically recreate this:

Simple Fortune Procedure
I only used diamond as an example, you would want to use whatever item your ore is supposed to drop.

You can change the drop percentages by adjusting the number on the right side, found here:
Drop rate

This for example would be a 38% drop chance. You could change it to 0.1 for 10% or 0.25 for 25%, etc.

It turns out it wasn't too difficult to make fortune work, just a little tedious.
Hopefully this helps some of you! :)

Edited by pomarf on Thu, 08/29/2019 - 10:28
Joined Feb 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just recreated it myself,…
Tue, 06/30/2020 - 23:03

Just recreated it myself, here ya go. :)

http://www.mediafire.com/file/pzvg5x4v7kldhdv/fortune.ptpl/file

Go to the editor where you get the options for the coding blocks and then hit "Import procedure" at the top right, and then choose the .ptpl file, and it should plop the whole thing in for you (make sure to connect the Event Trigger to the rest of it all though).

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just FYI, after doing some…
Tue, 06/30/2020 - 23:41

Just FYI, after doing some learning and testing, this procedure overrides the default behavior of the block drop. Basically meaning that no matter what tool you use to break the block (even using your hand), will call this procedure and drop items. There is no good way to do fortune yet in MCreator. Your best bet would be to just create your own loot table JSON files for each block.