Topic category: User side tutorials
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.
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:
You can change the drop percentages by adjusting the number on the right side, found here:
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! :)
Very nice tutorial !
Good tutorial.
If we procede this way, every block that you mine with the pickaxe you have set this setting on will fortune every type of block wich will give you diamonds if you mine any type of block.
This procedure goes on the block, not the tool.
So you would use whatever your block is supposed to drop, I just used diamond in this for an example.
Very good tutorial. As a suggestion, make to sure to check if the player is on adventure or survival mode, or the XP and gems will also appear if the player is in creative mode.
very good, thx
I know this is old, but just curious.. Is there a way to apply procedures like this to a vanilla block? For example, if I wanted to make vanilla iron ore drop a chunk of iron instead of the block and have fortune capabilities for it.
Vanilla is not editable without coding+hacking
So through coding, I know you can create an event handler and check when a block is destroyed and if it's a certain block, you can clear the drops and add your own. MCreator doesn't have this capability to handle events like that?
thesupermodder: You CAN apply this to vanilla blocks. There is a on block broken global trigger for all blocks
which works as a standard forge event :D
Thanks for confirming that it can be done. I was looking at that trigger and playing around with it. Out of curiosity, is there any downside to spawning in an item when a block is broken rather than changing the actual drop of the block (aside from the weirdness of the item going flying when it spawns in)?
it would override drops from other mods, and it won't be compatible with datapack loot tables.
Is there a better way to accomplish this via a loot table? If so, how would that be done? I didn't know loot tables could be applied to just a basic ore block.
can you put a download link to this pleas i need it and i am to lazy