Topic category: Help with Minecraft modding (Java Edition)
I am making a mod where there are two dimensions: overworld and psychic_home. I want to make it so that when you place or break a block in overworld, it places or breaks a block in the psychic_home. In psychic_home all blocks are the same block to make this easier. I already made two function labelled [mod]. Furthermore, here is what I did in the break commands:
execute in ModName:Dimension run forceload add ~ ~
execute in ModName:Dimension run setblock ~ ~ ~ minecraft:air destroy
These are the two lines of code I used. And I know the problem. It works but it places the block on the player instead of where the block is mined or placed.
How do you set position to block placed in commands?
This is the real question and if anybody helps it will be greatly appreciated :)
(Side note: if you are scrolling for forums for this one, there is a block called [call function [NAME] at entity] I used that in procedures and a event of block placed/mined.)
I found it!
If you replace the block [Run function [NAME] at entity] with [Run function [NAME] at x y z] (do not replace the x, y, z) parts. It works! Also if you want to replace the blocks instead of breaking them change the end [destroy] part with [replace].
Can you provide images of procedures or codes. I am also trying to make something like this I tried to use arrays to save blocks positions then place them in for loop when player changes dimensions but it didn't compile and just gave errors.
Yea sure