SOLVED: Place block in different dimension to the main one

Started by Mr.Pixel on

Topic category: Help with modding (Java Edition)

Last seen on 08:58, 20. Apr 2024
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
SOLVED: Place block in different dimension to the main one
Tue, 03/12/2024 - 06:44 (edited)

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.)

 

 

Edited by Mr.Pixel on Tue, 03/12/2024 - 06:44
Last seen on 08:58, 20. Apr 2024
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I found it! If you replace…
Tue, 03/12/2024 - 06:43

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]. 

Last seen on 09:26, 27. Apr 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you provide images of…
Thu, 03/21/2024 - 19:28

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.

Last seen on 08:58, 20. Apr 2024
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yea sure
Wed, 04/17/2024 - 19:10

Yea sure