3
Mining modification help
Hello guys,
I'm new to creating the vast world of datapacks and could use a little help.
I'm interested in modifying a pickaxe so that it can mine one more block in front as well as the same on the block below.
I took different packs to understand but I'm happy to be lost with this:
execute if block ~1 ~1 ~ #minecraft:break_list run setblock ~1 ~1 ~ air destroy
execute if block ~1 ~ ~ #minecraft:break_list run setblock ~1 ~ ~ air destroy
execute if block ~1 ~-1 ~ #minecraft:break_list run setblock ~1 ~-1 ~ air destroy
execute if block ~-1 ~1 ~ #minecraft:break_list run setblock ~-1 ~1 ~ air destroy
execute if block ~-1 ~ ~ #minecraft:break_list run setblock ~-1 ~ ~ air destroy
execute if block ~-1 ~-1 ~ #minecraft:break_list run setblock ~-1 ~-1 ~ air destroy
execute if block ~ ~1 ~ #minecraft:break_list run setblock ~ ~1 ~ air destroy
execute if block ~ ~-1 ~ #minecraft:break_list run setblock ~ ~-1 ~ air destroy
and this for the 4 directions, as well as up and down.
A little nudge would be welcome.
Thanks for your help
I'm new to creating the vast world of datapacks and could use a little help.
I'm interested in modifying a pickaxe so that it can mine one more block in front as well as the same on the block below.
I took different packs to understand but I'm happy to be lost with this:
execute if block ~1 ~1 ~ #minecraft:break_list run setblock ~1 ~1 ~ air destroy
execute if block ~1 ~ ~ #minecraft:break_list run setblock ~1 ~ ~ air destroy
execute if block ~1 ~-1 ~ #minecraft:break_list run setblock ~1 ~-1 ~ air destroy
execute if block ~-1 ~1 ~ #minecraft:break_list run setblock ~-1 ~1 ~ air destroy
execute if block ~-1 ~ ~ #minecraft:break_list run setblock ~-1 ~ ~ air destroy
execute if block ~-1 ~-1 ~ #minecraft:break_list run setblock ~-1 ~-1 ~ air destroy
execute if block ~ ~1 ~ #minecraft:break_list run setblock ~ ~1 ~ air destroy
execute if block ~ ~-1 ~ #minecraft:break_list run setblock ~ ~-1 ~ air destroy
and this for the 4 directions, as well as up and down.
A little nudge would be welcome.
Thanks for your help
12
Hi Kefaku,
I had to tamper a bit, especially on east and west where I had to add two additional lines.
I canceled up and down, too many complications.
But it finally works, I arrived at a good compromise.
Thank you very much for your help !
I had to tamper a bit, especially on east and west where I had to add two additional lines.
I canceled up and down, too many complications.
But it finally works, I arrived at a good compromise.
Thank you very much for your help !
What exactly is the problem with the commands you came up with?
What would you like them to do instead of what they do right now?
What would you like them to do instead of what they do right now?
I would like to have the same for all the directions as the east does. 1 block depper and 2 blocks depht in front of me.
when i'm facinf north or west or south it breaks blocks beside me...
when i'm facinf north or west or south it breaks blocks beside me...
I'm not exactly sure, but I think you need 4 different mcfunction files for the 4 different directions, which all break blocks in different locations as I pointed out in my last comment.
Currently it breaks the block I'm aiming for as well as the one above and below and the same left and right.
I would like it to break only the block below (not those on the sides) but on the other hand it would mine 1 more depth
I would like it to break only the block below (not those on the sides) but on the other hand it would mine 1 more depth
I hope I'm understanding you correctly. If that isn't what you want achieve or you came across additional questions, feel free to ask, but here's what I think you should do:
I assume, that the location ~ ~ ~ is where the original block is broken by the player. (Correct?)
First you "would like it to break only the block below", so we remove everything except the line for below:
execute if block ~1 ~1 ~ #minecraft:break_list run setblock ~1 ~1 ~ air destroy
execute if block ~1 ~ ~ #minecraft:break_list run setblock ~1 ~ ~ air destroy
execute if block ~1 ~-1 ~ #minecraft:break_list run setblock ~1 ~-1 ~ air destroy
execute if block ~-1 ~1 ~ #minecraft:break_list run setblock ~-1 ~1 ~ air destroy
execute if block ~-1 ~ ~ #minecraft:break_list run setblock ~-1 ~ ~ air destroy
execute if block ~-1 ~-1 ~ #minecraft:break_list run setblock ~-1 ~-1 ~ air destroy
execute if block ~ ~1 ~ #minecraft:break_list run setblock ~ ~1 ~ air destroy
execute if block ~ ~-1 ~ #minecraft:break_list run setblock ~ ~-1 ~ air destroy
Then you want it to "mine 1 more depth". I'm not sure whether you mean 1 more block down (1 block deeper) or 1 block more depth in the direction the player is facing, while breaking the original block (1 block more depth).
The first variant would mean you just have to add 1 line, which breaks an additional block 1 block deeper:
execute if block ~ ~-1 ~ #minecraft:break_list run setblock ~ ~-1 ~ air destroy
execute if block ~ ~-2 ~ #minecraft:break_list run setblock ~ ~-2 ~ air destroy
The second variant would mean you'd have to add two lines, that break additional blocks in the facing direction instead. Therefore you'd have to add 1 to the axis that was just ~ in all the commands you had before (for that specific direction):
execute if block ~ ~-1 ~ #minecraft:break_list run setblock ~ ~-1 ~ air destroy
execute if block ~ ~-1 ~1 #minecraft:break_list run setblock ~ ~-1 ~1 air destroy
execute if block ~ ~ ~1 #minecraft:break_list run setblock ~ ~ ~1 air destroy
This might break additional blocks, where you stand, instead of behind the block that was broken, then you'd have to replace all the 1 with -1.
Then you'd need to repeat this "for the 4 directions, as well as up and down". I assume you have a seperate *.mcfunction file for every direction.
Also, I don't know what your block tag #minecraft:break_list contains. If you just want it to break the stuff a standard pickaxe is used to break, there already is an existing block tag called #minecraft:mineable/pickaxe, so if that's what you need you wouldn't have to add a custom block tag.
I assume, that the location ~ ~ ~ is where the original block is broken by the player. (Correct?)
First you "would like it to break only the block below", so we remove everything except the line for below:
execute if block ~1 ~1 ~ #minecraft:break_list run setblock ~1 ~1 ~ air destroy
execute if block ~1 ~ ~ #minecraft:break_list run setblock ~1 ~ ~ air destroy
execute if block ~1 ~-1 ~ #minecraft:break_list run setblock ~1 ~-1 ~ air destroy
execute if block ~-1 ~1 ~ #minecraft:break_list run setblock ~-1 ~1 ~ air destroy
execute if block ~-1 ~ ~ #minecraft:break_list run setblock ~-1 ~ ~ air destroy
execute if block ~-1 ~-1 ~ #minecraft:break_list run setblock ~-1 ~-1 ~ air destroy
execute if block ~ ~1 ~ #minecraft:break_list run setblock ~ ~1 ~ air destroy
execute if block ~ ~-1 ~ #minecraft:break_list run setblock ~ ~-1 ~ air destroy
Then you want it to "mine 1 more depth". I'm not sure whether you mean 1 more block down (1 block deeper) or 1 block more depth in the direction the player is facing, while breaking the original block (1 block more depth).
The first variant would mean you just have to add 1 line, which breaks an additional block 1 block deeper:
execute if block ~ ~-1 ~ #minecraft:break_list run setblock ~ ~-1 ~ air destroy
execute if block ~ ~-2 ~ #minecraft:break_list run setblock ~ ~-2 ~ air destroy
The second variant would mean you'd have to add two lines, that break additional blocks in the facing direction instead. Therefore you'd have to add 1 to the axis that was just ~ in all the commands you had before (for that specific direction):
execute if block ~ ~-1 ~ #minecraft:break_list run setblock ~ ~-1 ~ air destroy
execute if block ~ ~-1 ~1 #minecraft:break_list run setblock ~ ~-1 ~1 air destroy
execute if block ~ ~ ~1 #minecraft:break_list run setblock ~ ~ ~1 air destroy
This might break additional blocks, where you stand, instead of behind the block that was broken, then you'd have to replace all the 1 with -1.
Then you'd need to repeat this "for the 4 directions, as well as up and down". I assume you have a seperate *.mcfunction file for every direction.
Also, I don't know what your block tag #minecraft:break_list contains. If you just want it to break the stuff a standard pickaxe is used to break, there already is an existing block tag called #minecraft:mineable/pickaxe, so if that's what you need you wouldn't have to add a custom block tag.
Yes, exactly!
Just keep in mind "This might break additional blocks, where you stand, instead of behind the block that was broken, then you'd have to replace all the 1 with -1."
Just keep in mind "This might break additional blocks, where you stand, instead of behind the block that was broken, then you'd have to replace all the 1 with -1."
Hi Kefaku,
So I writed the commands on all my mcfunctions directions and it works perfectly on east (even when i'm looking up or down it's ok for me) but it's a mess on the three others...
It breaks the 2 more blocks at the south direction i'm facing...
So I writed the commands on all my mcfunctions directions and it works perfectly on east (even when i'm looking up or down it's ok for me) but it's a mess on the three others...
It breaks the 2 more blocks at the south direction i'm facing...
View 1 more replies

