Pickaxe for auto melting

Started by WenyaFox on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Pickaxe for auto melting

There is a question. Is it possible to make a pick for auto melting on version 1.18.2? Thanks in advance!

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you mean when you mine an…
Sat, 06/11/2022 - 18:07

you mean when you mine an ore it gives you the smelted version?

in the item procedures section, there's something called "get smelting result of [item]"

make a procedure that's triggered when the pickaxe mines something, and then if there is an item entity within a 1 block radius of [x + 0.5], [y + 0.5], [z + 0.5], then replace the value of the item entity with the smelting result of itself

you gotta do the + 0.5 because Minecraft takes block positions from the corner of the block and you wanna use the center instead of the corner

the "nearest entity" block i mentioned is in the world data section

you gotta detect the item entity cuz if you try to detect the block that was mined, it'll detect the position of the block and see that it is air, cuz it was just destroyed