3x3 Smelting Pickaxe

Started by Fire_Brantley on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
3x3 Smelting Pickaxe

So I'm trying to make a pickaxe that can mine in a 3x3 area and smelt ores at the same time, but it only smelts the block you actually mine. Does anyone know a way I can fix this?

Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok so you need to make it so…
Wed, 06/26/2024 - 03:14

ok so you need to make it so when a block is broken cancel it, break all blocks ajacent and the block without dropping the item and then use conversions to convert the block to the smelted item and drop it.

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok, im pretty new to…
Wed, 06/26/2024 - 12:08

ok, im pretty new to procedures so do you think you might be able to make an example? I will still try to mess around w/ it tho.

Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ho boy... What you asked for…
Fri, 07/12/2024 - 17:53

Ho boy... What you asked for is pretty simply in theory, but still involves a good amount of procedure work!

I created both a smelting enchantment as well as a 3x3 mining procedure for one of my mods. I initially started to try and both show and explain what I had; however, I realized it wasn't as efficient as it could be. It was more work than necessary.

So, I spent some time recreating the procedure and implemented the smelting ability to the 3x3 mining procedure itself.

Any questions feel free to ask.
Here are the other images I was going to send- of my smelting enchantment procedure and showing off parts of my older 3x3 mining procedures: https://imgur.com/a/9YqiOn7 

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No offence but I do not…
Sat, 07/27/2024 - 02:26

No offence but I do not understand any of this. Thx for the help tho.

Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Since you're working with…
Sat, 07/27/2024 - 04:16

Since you're working with three dimensions, in order to mine in a 3x3 shape, you need to figure out which face you're looking at of the block you're mining, and from that information, figure out which eight blocks around that block you want to break as well.

This procedure first declares and sets a few variables and then declares and sets a few more variables depending on that block face.

When ever you're working with a procedure that uses numerous variables that you might want to change, it's good practice to create custom variables and use those. So you don't have to update every single instance of the variable, and instead you only need to update one instance of it.

The green portion of the procedure consists of several repeating blocks that execute blocks within them a set number of times. You can view these as the x, y, and z axes. Each repeat block will execute a specific number of times depending on which direction you're mining.

The big if statements inside the repeat blocks check and compare certain characteristics on the blocks you're attempting to mine to see if the tool you're using is able to break them properly or not. And if it is, it determines how they should be broken- whether via smelting the drops or not.

Lastly, the procedure tries repairing the tool by one durability. This is because the tool loses one durability automatically as it is being used, but then the procedure causes it to lose one further durability for each block- including the middle block you just broke. This would result in ten damage for mining nine blocks. So, restoring one durability on the tool after the fact is a bit of a band-aid fix. You also have to check to make sure that the durability isn't at or below zero before you repair it, though, otherwise the procedure may prevent the tool from ever breaking.