Is there any way to make a block to have a chance of dropping my custom item when i finish brushing it? [SOLVED]

Started by Kozzy. on

Topic category: Help with modding (Java Edition)

Last seen on 21:43, 3. Mar 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there any way to make a block to have a chance of dropping my custom item when i finish brushing it? [SOLVED]
Wed, 01/03/2024 - 00:56 (edited)

So, minecraft added this brush thing that let you brush some blocks to find items inside it.
And i want to to do a ancient rune fragment chance for dropping from it, but for doing it i need to know how to make something drop when i finish using the brush on the block (or if i keep brushing it for more than 40 ticks).

If someone could make a template procedure for me with the solution and explain what the procedure does in pieces would be really good :3
(sorry for my english, i dont speak very well)

Edited by Kozzy. on Wed, 01/03/2024 - 00:56
Last seen on 10:38, 22. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you want suspicious sand,…
Tue, 01/02/2024 - 19:58

If you want suspicious sand, or suspicious gravel to drop your custom block, you can replace the vanilla archeology loot table with your own. (You would need to make a new loot table with an identical name to the original archeology loot table- but this will replace the entire loot table, not just one item.) The names of these loot tables are:

  1. archaeology/desert_pyramid
  2. archaeology/desert_well
  3. archaeology/ocean_ruin_cold
  4. archaeology/ocean_ruin_warm
  5. archaeology/trail_ruin_common
  6. archaeology/trail_ruin_rare

...To save time, you could also lock your loot table, and then copy and paste the vanilla loot table in, plus the one item you want to add. 

If you want to make your own custom block that behaves the same as suspicious sand or suspicious gravel, it will be more difficult, but not impossible. You will need multiple textures, along with multiple blockstates, and some sort of variable or nbt tag to keep track of how close the block is to finished. 

Last seen on 21:43, 3. Mar 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah thats what i want, btw…
Tue, 01/02/2024 - 20:18

yeah thats what i want, btw how i paste a vanilla loot table on my loot table?

 

Last seen on 10:38, 22. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
All you have to do is name…
Tue, 01/02/2024 - 22:35

All you have to do is name the loot table the same as the vanilla loot table, and it will override it. If you don't want to also make the rest of the original loot table, you could save time by locking the mod element, going to MCAsset, copying the vanilla loot table you want to override, and pasting all of the other code into there in addition to the item you added. 

But if you don't want to mess with raw code, you can also just use the vanilla loot table as a reference and rebuild a new loot table, including the vanilla items alongside your own.

Last seen on 21:43, 3. Mar 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thank you!
Wed, 01/03/2024 - 00:56

thank you!