#Multiblock structure not working
1 messages · Page 1 of 1 (latest)
Hello, I have been trying to make a multi block structure work, like in modded playthroughs, and the detections is working, but when I try to remove the test blocks the detection still dose not work?!
For more information here is the github repositiory:
https://github.com/TheTeleporter9/Techwars---Ore-generator/tree/main/data/tw/functions/extractor/placementz
Can somebody please help
[35mexecute [34mas [36m@s [34mat [36m@s [34mif block [32m~ ~3 ~ [0mair [34munless entity [36m@e[33m[[37mtype[34m=[32mblock_display[34m,[37mtag[34m=[32mtw_extr[34m,[37mdistance[34m=[35m..[32m3[33m] [34mrun [30m\
[35mplace [34mtemplate [33mminecraft:extractor_n [32m~-1 ~3 ~-1
[35mexecute [34mif entity [36m@e[33m[[37mtype[34m=[32mitem[33m] [34mpositioned [32m~-1 ~3 ~-1 [30m\
[34mif blocks [32m~ ~ ~ ~3 ~3 ~3 ~ ~-6 ~ [0mmasked [34mrun [30m\
[35mfunction [33mtw:extractor/placement/placement
[35mexecute [34mif entity [36m@e[33m[[37mtype[34m=[32mitem[33m] [34mpositioned [32m~-1 ~3 ~-1 [30m\
[34munless blocks [32m~ ~ ~ ~3 ~3 ~3 ~ ~-6 ~ [0mmasked [34mrun [30m\
[35mfunction [33mtw:extractor/placement/remove
Here is a video which might help to explain the problem
I don't understand
so when I activate the execute if blocks command, it works, but when I have the unless command active at the same time it ovverrides the first command
Is your if blocks changing those blocks when it succeeds?
no, it summons a display enity, and removes the checking blocks/structure:
[35mexecute [34malign xyz positioned [32m~-0.05 ~ ~-0.05 [30m\
[34munless entity [36m@e[33m[[37mtype[34m=[32mblock_display[34m,[37mtag[34m=[32mtw_extr[34m,[37mdistance[34m=[35m..[32m3[34m,[37mlimit[34m=[32m1[33m] [34mrun [30m\
[35msummon [0mblock_display [32m~1 ~-3 ~1 [30m\
[33m{[37mTags[34m:[35m[[32m"tw"[34m,[32m"tw_extr"[35m][34m,[37mtransformation[34m:[30m\
[35m{[37mleft_rotation[34m:[[32m0f[34m,[32m0f[34m,[32m0f[34m,[32m1f[34m],[37mright_rotation[34m:[[32m0f[34m,[32m0f[34m,[32m0f[34m,[32m1f[34m],[30m\
[37mtranslation[34m:[[32m-1f[34m,[32m-3f[34m,[32m-1f[34m],[37mscale[34m:[[32m3.1f[34m,[32m3.1f[34m,[32m3.1f[34m][35m}[34m,[30m\
[37mblock_state[34m:[35m{[37mName[34m:[32m"create:fluid_tank"[35m}[33m}
[35mexecute [34mas [36m@e[33m[[37mtype[34m=[32mblock_display[34m,[37mtag[34m=[32mtw_extr[33m] [34mrun [35mscoreboard [34mplayers add [36m@s [35mdata [32m0
[35mexecute [34mas [36m@s [34mat [36m@s [34munless block [32m~ ~3 ~ [0mair [34mif entity [36m@e[33m[[37mtype[34m=[32mblock_display[34m,[37mtag[34m=[32mtw_extr[34m,[37mdistance[34m=[35m..[32m3[33m] [34mrun [30m\
[35mplace [34mtemplate [33mminecraft:extractor_empty [32m~-1 ~3 ~-1
That sounds like it does change those blocks, no?
What are the blocks initially, and what happens to them after the success?
the way I check, is I place a structure 3 blocks above the middle of the structure below, where the wrench is thrown, and then I run the execute if check, then in the placement function I remove the same structure that was placed
I see, so the blocks that are getting checked themselves do not change?
yes, if I did not make a mistake...
So if the structure you're checking against is gone, how are you checking the unless blocks?
oh, good point, I don't, but could I not check if that blockdisplay is nearby?
You could
But for clarity, ignoring what you're currently doing, what do you actually want to happen? You want the wrench to detect if the 27 blocks below it are a specific set of blocks, and if they are, do a thing to them, and then check if they got broken to undo that thing?
yes
Pkay, then I would recommend making a predicate to check the blocks instead
It's gonna be long and a little tedious to write, but you only have to do it once
Then you can have the wrench check that predicate for the successful placement, and have the block display check the predicate to see if it's been broken
so then I don't need the execute blocks then
Of course, make sure to check that there isn't already a multiblock structure there so the wrench doesn't place multiple in the same spot
Right, you'd to execute if predicate instead
or unless
ok, and what prediacte type would I need to do this
An all_of predicate of 27 location predicates
can I use relative cordinates, srry I have not worked fully with predicates
You can set an offset from the origin, which will be wherever the command is being executed from
does this look somewhat correct?
{
"condition": "minecraft:all_of",
"terms": [
{
"condition": "minecraft:location_check",
"offsetX": 0,
"offsetY": 0,
"offsetZ": 0,
"predicate": {
"block": {
"blocks": [
"do-i-use-this-too"
],
"tag": "minecraft:stone_bricks"
}
}
}
]
}
If you're using the tag you probably don't need the list of blocks, as long as all the blocks you're checking are in that tag
wdym?
oh, I seee
will the blocks list check if the blocks are in order, or do I have to make one term per block in the structure
thank you!