Enchantment applies loot tables to vanilla blocks/entities?

Started by Linksvix99 on Tue, 08/25/2020 - 19:21

Topic category: Help with MCreator software

Last seen on 22:46, 7. Sep 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Enchantment applies loot tables to vanilla blocks/entities?
Tue, 08/25/2020 - 19:21

I'm making a mod based entirely around enchantments, and one enchantment I'm wanting to make involves smelting the block broken as soon as it's destroyed (yeah, so original, right? Smelting Touch has never been thought of before). But the problem is I can't figure out how to make the vanilla blocks check that they've been broken with a tool that has the enchantment, and I can't figure out how to make a certain item from a loot table only appear when a procedure calls for it (just as an example). And I was wanting the same thing to apply to a sword enchantment that has a random chance to drop an emerald when the mob is defeated (similar to how Prospector increases emerald drops in Minecraft Dungeons). If possible, I'd also like these enchantments to be affected by fortune and looting respectively, though it's not a necessity or required in any way, it'd just be great to have.

Last seen on 03:14, 28. Oct 2020
Joined Jun 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
There are blocks available…
Wed, 08/26/2020 - 05:01

There are blocks available in procedures to check if an item has an enchantment, and check for what level it has as well. All of what you want to do can be done with procedures, so I'd definitely recommend learning how to use procedures and getting much more used to using them. Something along the lines of "if item in main hand of player has enchantment "custom", and if block broken is "iron ore", then spawn "iron ingot" at "x y z", placed in the global trigger (when block broken). Apply that same idea to your other enchantments and you can do anything you want.

Last seen on 22:46, 7. Sep 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
The problem with that is…
Sun, 09/06/2020 - 22:49

The problem with that is when I break the block I end up getting both the block I break as well as the item I want it to drop. Is there any way I can delete the block drop without deleting any others that may be dropped on the ground? For example, if the player decides to throw out an iron ore block they had picked up because they had mistakenly used the wrong pickaxe, how can I let the player still have that item entity there and also remove the next iron ore they mine with my "Furnace Touch" as I'm calling it?

Last seen on 22:46, 7. Sep 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Never mind, I figured it out…
Mon, 09/07/2020 - 13:31

Never mind, I figured it out. I just had to remove the block from the world when it was broken. Now I can use that procedure as a base for all the block breaking enchantments, thank you.