execute as @a[scores={re8_dimension_portal_activation_check=1..},predicate=re8portals:dimensions/overworld] at @s rotated as @s anchored eyes run function re8portals:activate/locate_block/re8_dimension
execute as @a[scores={re8_dimension_portal_activation_check=1..},predicate=re8portals:dimensions/re8_dimension] at @s rotated as @s anchored eyes run function re8portals:activate/locate_block/re8_dimension
scoreboard players set @a re8_dimension_portal_activation_check 0
function re8portals:run/main/re8_dimension
execute as @e[predicate=re8portals:travellers/all_mobs] unless score @s re8portals_cooldown = @s re8portals_cooldown run scoreboard players set @s re8portals_cooldown 0
execute as @e[predicate=re8portals:travellers/all_mobs,scores={re8portals_cooldown=1..}] unless entity @e[type=armor_stand,tag=re8portals_portal_stand,distance=...5] run scoreboard players remove @s re8portals_cooldown 1
```
#### 在functions包中新建`timer.mcfunction`文件,对我们当前进行计时:
`timer.mcfunction`
```
scoreboard players add #re8portals_timer re8portals_timer 1
execute if score #re8portals_timer re8portals_timer matches 10.. run scoreboard players set #re8portals_timer re8portals_timer 0
```
#### 在functions包中新建`run`包 -> `run`包中新建`main`包 -> `main`包中新建以我们维度名称命名的功能文件`re8_dimension.mcfunction`
`re8_dimension.mcfunction`
```
# If there's an entity in the portal, load the other dimension to check if there's a portal
execute as @e[type=armor_stand,tag=wabportals_aether_portal_stand,predicate=re8portals:dimensions/overworld] at @s if entity @e[predicate=re8portals:travellers/all_mobs,distance=..0.5,scores={re8portals_cooldown=0}] as @e[type=marker,tag=re8portals_re8_dimension_marker,sort=nearest,limit=1] in re8joymod:re8_dimension run forceload add ~5 ~5 ~-5 ~-5
execute as @e[type=armor_stand,tag=wabportals_aether_portal_stand,predicate=re8portals:dimensions/re8_dimension] at @s if entity @e[predicate=re8portals:travellers/all_mobs,distance=..0.5,scores={re8portals_cooldown=0}] as @e[type=marker,tag=re8portals_re8_dimension_marker,sort=nearest,limit=1] in minecraft:overworld run forceload add ~5 ~5 ~-5 ~-5
# If there is a portal in the other dimension, tp the player
execute as @e[type=armor_stand,tag=wabportals_aether_portal_stand,predicate=re8portals:dimensions/overworld] at @s if entity @e[predicate=re8portals:travellers/all_mobs,distance=..0.5,scores={re8portals_cooldown=0}] as @e[type=marker,sort=nearest,limit=1,tag=re8portals_re8_dimension_marker] at @s in re8joymod:re8_dimension if entity @e[type=marker,tag=re8portals_re8_dimension_marker,predicate=re8portals:dimensions/re8_dimension,distance=..384] in minecraft:overworld as @e[predicate=re8portals:travellers/all_mobs,predicate=re8portals:dimensions/overworld,distance=...5,scores={re8portals_cooldown=0}] at @s run function re8portals:run/teleport/re8_dimension/dim1
execute as @e[type=armor_stand,tag=wabportals_aether_portal_stand,predicate=re8portals:dimensions/re8_dimension] at @s if entity @e[predicate=re8portals:travellers/all_mobs,distance=..0.5,scores={re8portals_cooldown=0}] as @e[type=marker,sort=nearest,limit=1,tag=re8portals_re8_dimension_marker] at @s in minecraft:overworld if entity @e[type=marker,tag=re8portals_re8_dimension_marker,predicate=re8portals:dimensions/overworld,distance=..384] in re8joymod:re8_dimension as @e[predicate=re8portals:travellers/all_mobs,predicate=re8portals:dimensions/re8_dimension,distance=...5,scores={re8portals_cooldown=0}] at @s run function re8portals:run/teleport/re8_dimension/dim2
# Make a portal if there isn't one
execute as @e[type=armor_stand,tag=wabportals_aether_portal_stand,predicate=re8portals:dimensions/overworld] at @s if entity @e[predicate=re8portals:travellers/all_mobs,distance=..0.5,scores={re8portals_cooldown=0}] as @e[type=marker,sort=nearest,limit=1,tag=re8portals_re8_dimension_marker] at @s in re8joymod:re8_dimension unless entity @e[type=marker,tag=re8portals_re8_dimension_marker,predicate=re8portals:dimensions/re8_dimension,distance=..384] align xyz run function re8portals:run/create_alternate/re8_dimension/dim1
execute as @e[type=armor_stand,tag=wabportals_aether_portal_stand,predicate=re8portals:dimensions/re8_dimension] at @s if entity @e[predicate=re8portals:travellers/all_mobs,distance=..0.5,scores={re8portals_cooldown=0}] as @e[type=marker,sort=nearest,limit=1,tag=re8portals_re8_dimension_marker] at @s in minecraft:overworld unless entity @e[type=marker,tag=re8portals_re8_dimension_marker,predicate=re8portals:dimensions/overworld,distance=..384] align xyz run function re8portals:run/create_alternate/re8_dimension/dim2
# Check if any portals got broken, and if so, close them.
execute as @e[type=marker,tag=re8portals_re8_dimension_marker_z] at @s run function re8portals:run/check_if_broken/re8_dimension/z
execute as @e[type=marker,tag=re8portals_re8_dimension_marker_x] at @s run function re8portals:run/check_if_broken/re8_dimension/x
```
#### `run`包中新建`create_alternate`包 -> 包中新建我们的维度包`re8_dimension` -> 包中新建两个功能类,一个是
`dim1.mcfunction`,一个是`dim2.mcfunction`,用于创建两个维度的传送门。
`dim1.mcfunction`
```
fill ~2 ~-1 ~ ~-1 ~3 ~ re8joymod:dhands_block
fill ~ ~ ~ ~1 ~2 ~ minecraft:moving_piston
# Summon the marker to make the portal work
summon marker ~.5 ~ ~.506 {NoGravity:1b,Silent:1b,Invulnerable:1b,Tags:["re8portals_re8_dimension_marker","re8portals_re8_dimension_marker_x"]}
# Play a portal opening sound (OPTIONAL)
playsound minecraft:block.end_portal.spawn master @a ~ ~ ~ 15 1
# Get rid of everything unnecessary
forceload remove ~-10 ~-10 ~10 ~10
```
`dim2.mcfunction`
```
# Make the portal frame itself
fill ~2 ~-1 ~ ~-1 ~3 ~ re8joymod:dhands_block
fill ~ ~ ~ ~1 ~2 ~ minecraft:moving_piston
# Summon the marker to make the portal work
summon marker ~.5 ~ ~.506 {NoGravity:1b,Silent:1b,Invulnerable:1b,Tags:["re8portals_re8_dimension_marker","re8portals_re8_dimension_marker_x"]}
# Play a portal opening sound (OPTIONAL)
playsound minecraft:block.end_portal.spawn master @a ~ ~ ~ 15 1
# Get rid of everything unnecessary
forceload remove ~-10 ~-10 ~10 ~10
```
#### `run`包中新建`teleport`包 -> 包中新建我们的维度包`re8_dimension` -> 包中新建两个功能类,一个是
`dim1.mcfunction`,一个是`dim2.mcfunction`,用于在两个维度之间实现传送。
`dim1.mcfunction`
```
# 执行从主世界中传送到我们的维度的指令,这里要修改为你的modid:你的维度
execute in re8joymod:re8_dimension run teleport @s ~ ~ ~
scoreboard players set @s re8portals_cooldown 300
execute in re8joymod:re8_dimension run forceload remove ~5 ~5 ~-5 ~-5
execute in minecraft:overworld run forceload remove ~5 ~5 ~-5 ~-5
```
`dim2.mcfunction`
```
# 从我们的维度传送回主世界
execute in minecraft:overworld run teleport @s ~ ~ ~
scoreboard players set @s re8portals_cooldown 300
execute in re8joymod:re8_dimension run forceload remove ~5 ~5 ~-5 ~-5
execute in minecraft:overworld run forceload remove ~5 ~5 ~-5 ~-5
```
#### `run`包中新建`check_if_broken`包 -> 包中新建我们的维度包`re8_dimension` -> 包中新建两个功能类,一个是
`x.mcfunction`,一个是`z.mcfunction`,用于判断两个维度的传送门是否损坏。
`x.mcfunction`
```
# 判断东西方向是否损坏
execute if block ~ ~-1 ~ #re8portals:frame/re8_dimension if block ~1 ~-1 ~ #re8portals:frame/re8_dimension if block ~2 ~ ~ #re8portals:frame/re8_dimension if block ~-1 ~ ~ #re8portals:frame/re8_dimension if block ~2 ~1 ~ #re8portals:frame/re8_dimension if block ~-1 ~1 ~ #re8portals:frame/re8_dimension if block ~2 ~2 ~ #re8portals:frame/re8_dimension if block ~-1 ~2 ~ #re8portals:frame/re8_dimension if block ~ ~3 ~ #re8portals:frame/re8_dimension if block ~1 ~3 ~ #re8portals:frame/re8_dimension if block ~1 ~ ~ #re8portals:portal/re8_dimension if block ~ ~1 ~ #re8portals:portal/re8_dimension if block ~1 ~1 ~ #re8portals:portal/re8_dimension if block ~ ~2 ~ #re8portals:portal/re8_dimension if block ~1 ~2 ~ #re8portals:portal/re8_dimension run tag @s add unbroken
# If it was, kill all the portal block armor stands
execute as @s[tag=!unbroken] positioned ~ ~ ~ run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
execute as @s[tag=!unbroken] positioned ~ ~1 ~ run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
execute as @s[tag=!unbroken] positioned ~ ~2 ~ run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
execute as @s[tag=!unbroken] positioned ~1 ~ ~ run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
execute as @s[tag=!unbroken] positioned ~1 ~1 ~ run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
execute as @s[tag=!unbroken] positioned ~1 ~2 ~ run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
# If it was, destroy all the portal blocks (OPTIONAL if you just used air)
execute as @s[tag=!unbroken] run fill ~ ~ ~ ~1 ~2 ~ air replace #re8portals:portal/re8_dimension
# If it was, play a portal breaking sound (OPTIONAL)
execute as @s[tag=!unbroken] positioned ~ ~ ~ run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
execute as @s[tag=!unbroken] positioned ~ ~1 ~ run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
execute as @s[tag=!unbroken] positioned ~ ~2 ~ run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
execute as @s[tag=!unbroken] positioned ~1 ~ ~ run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
execute as @s[tag=!unbroken] positioned ~1 ~1 ~ run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
execute as @s[tag=!unbroken] positioned ~1 ~2 ~ run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
# If it was, kill the marker to fully delete the portal
execute as @s[tag=!unbroken] run kill @s
# If it wasn't broken, remove the unbroken tag so that it can be checked again
execute as @s[tag=unbroken] run tag @s remove unbroken
```
`z.mcfunction`
```
# 判断南北方向是否损坏
execute if block ~ ~-1 ~ #re8portals:frame/re8_dimension if block ~ ~-1 ~1 #re8portals:frame/re8_dimension if block ~ ~ ~-1 #re8portals:frame/re8_dimension if block ~ ~ ~2 #re8portals:frame/re8_dimension if block ~ ~1 ~-1 #re8portals:frame/re8_dimension if block ~ ~1 ~2 #re8portals:frame/re8_dimension if block ~ ~2 ~-1 #re8portals:frame/re8_dimension if block ~ ~2 ~2 #re8portals:frame/re8_dimension if block ~ ~3 ~ #re8portals:frame/re8_dimension if block ~ ~3 ~1 #re8portals:frame/re8_dimension if block ~ ~ ~1 #re8portals:portal/re8_dimension if block ~ ~1 ~ #re8portals:portal/re8_dimension if block ~ ~1 ~1 #re8portals:portal/re8_dimension if block ~ ~2 ~ #re8portals:portal/re8_dimension if block ~ ~2 ~1 #re8portals:portal/re8_dimension run tag @s add unbroken
# If it was, kill all the portal block armor stands (OPTIONAL if you didn't add these in the create file)
execute as @s[tag=!unbroken] positioned ~ ~ ~ run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
execute as @s[tag=!unbroken] positioned ~ ~1 ~ run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
execute as @s[tag=!unbroken] positioned ~ ~2 ~ run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
execute as @s[tag=!unbroken] positioned ~ ~ ~1 run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
execute as @s[tag=!unbroken] positioned ~ ~1 ~1 run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
execute as @s[tag=!unbroken] positioned ~ ~2 ~1 run kill @e[distance=..0.5,type=armor_stand,tag=wabportals_aether_portal_stand]
# If it was, destroy all the portal blocks (OPTIONAL if you just used air)
execute as @s[tag=!unbroken] run fill ~ ~ ~ ~ ~2 ~1 air replace #re8portals:portal/re8_dimension
# If it was, play a portal breaking sound (OPTIONAL)
execute as @s[tag=!unbroken] positioned ~ ~ ~ run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
execute as @s[tag=!unbroken] positioned ~ ~1 ~ run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
execute as @s[tag=!unbroken] positioned ~ ~2 ~ run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
execute as @s[tag=!unbroken] positioned ~ ~ ~1 run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
execute as @s[tag=!unbroken] positioned ~ ~1 ~1 run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
execute as @s[tag=!unbroken] positioned ~ ~2 ~1 run playsound minecraft:block.glass.break master @a ~ ~ ~ 15 1
# If it was, kill the marker to fully delete the portal
execute as @s[tag=!unbroken] run kill @s
# If it wasn't broken, remove the unbroken tag so that it can be checked again
execute as @s[tag=unbroken] run tag @s remove unbroken
```
#### 在functions包中新建`activate`包 -> `activate`包中新建`check_frame`包 -> `check_frame`包中新建以我们维度名称命名的包`re8_dimension` -> 包中新建三个功能文件`bottom.mcfunction`、`mid.mcfunction`、`top.mcfunction`
`bottom.mcfunction`
```
# 查看我们传送门底部是否有对应的方块
# North
execute if block ~ ~-1 ~ #re8portals:frame/re8_dimension if block ~ ~-1 ~1 #re8portals:frame/re8_dimension if block ~ ~ ~-1 #re8portals:frame/re8_dimension if block ~ ~ ~2 #re8portals:frame/re8_dimension if block ~ ~1 ~-1 #re8portals:frame/re8_dimension if block ~ ~1 ~2 #re8portals:frame/re8_dimension if block ~ ~2 ~-1 #re8portals:frame/re8_dimension if block ~ ~2 ~2 #re8portals:frame/re8_dimension if block ~ ~3 ~ #re8portals:frame/re8_dimension if block ~ ~3 ~1 #re8portals:frame/re8_dimension if block ~ ~ ~1 #re8portals:air if block ~ ~1 ~ #re8portals:air if block ~ ~1 ~1 #re8portals:air if block ~ ~2 ~ #re8portals:air if block ~ ~2 ~1 #re8portals:air positioned ~ ~ ~ align xyz run function re8portals:activate/create/re8_dimension/z
# South
execute if block ~ ~-1 ~ #re8portals:frame/re8_dimension if block ~ ~-1 ~-1 #re8portals:frame/re8_dimension if block ~ ~ ~-2 #re8portals:frame/re8_dimension if block ~ ~ ~1 #re8portals:frame/re8_dimension if block ~ ~1 ~-2 #re8portals:frame/re8_dimension if block ~ ~1 ~1 #re8portals:frame/re8_dimension if block ~ ~2 ~-2 #re8portals:frame/re8_dimension if block ~ ~2 ~1 #re8portals:frame/re8_dimension if block ~ ~3 ~ #re8portals:frame/re8_dimension if block ~ ~3 ~-1 #re8portals:frame/re8_dimension if block ~ ~ ~-1 #re8portals:air if block ~ ~1 ~ #re8portals:air if block ~ ~1 ~-1 #re8portals:air if block ~ ~2 ~ #re8portals:air if block ~ ~2 ~-1 #re8portals:air positioned ~ ~ ~-1 align xyz run function re8portals:activate/create/re8_dimension/z
# East
execute if block ~ ~-1 ~ #re8portals:frame/re8_dimension if block ~-1 ~-1 ~ #re8portals:frame/re8_dimension if block ~1 ~ ~ #re8portals:frame/re8_dimension if block ~-2 ~ ~ #re8portals:frame/re8_dimension if block ~1 ~1 ~ #re8portals:frame/re8_dimension if block ~-2 ~1 ~ #re8portals:frame/re8_dimension if block ~1 ~2 ~ #re8portals:frame/re8_dimension if block ~-2 ~2 ~ #re8portals:frame/re8_dimension if block ~ ~3 ~ #re8portals:frame/re8_dimension if block ~-1 ~3 ~ #re8portals:frame/re8_dimension if block ~-1 ~ ~ #re8portals:air if block ~ ~1 ~ #re8portals:air if block ~-1 ~1 ~ #re8portals:air if block ~ ~2 ~ #re8portals:air if block ~-1 ~2 ~ #re8portals:air positioned ~-1 ~ ~ align xyz run function re8portals:activate/create/re8_dimension/x
# West
execute if block ~ ~-1 ~ #re8portals:frame/re8_dimension if block ~1 ~-1 ~ #re8portals:frame/re8_dimension if block ~2 ~ ~ #re8portals:frame/re8_dimension if block ~-1 ~ ~ #re8portals:frame/re8_dimension if block ~2 ~1 ~ #re8portals:frame/re8_dimension if block ~-1 ~1 ~ #re8portals:frame/re8_dimension if block ~2 ~2 ~ #re8portals:frame/re8_dimension if block ~-1 ~2 ~ #re8portals:frame/re8_dimension if block ~ ~3 ~ #re8portals:frame/re8_dimension if block ~1 ~3 ~ #re8portals:frame/re8_dimension if block ~1 ~ ~ #re8portals:air if block ~ ~1 ~ #re8portals:air if block ~1 ~1 ~ #re8portals:air if block ~ ~2 ~ #re8portals:air if block ~1 ~2 ~ #re8portals:air positioned ~ ~ ~ align xyz run function re8portals:activate/create/re8_dimension/x
```
`mid.mcfunction`
```
# 查看我们传送门中部是否有对应的方块
# North
execute if block ~ ~-2 ~ #re8portals:frame/re8_dimension if block ~ ~-2 ~1 #re8portals:frame/re8_dimension if block ~ ~-1 ~-1 #re8portals:frame/re8_dimension if block ~ ~-1 ~2 #re8portals:frame/re8_dimension if block ~ ~ ~-1 #re8portals:frame/re8_dimension if block ~ ~ ~2 #re8portals:frame/re8_dimension if block ~ ~1 ~-1 #re8portals:frame/re8_dimension if block ~ ~1 ~2 #re8portals:frame/re8_dimension if block ~ ~2 ~ #re8portals:frame/re8_dimension if block ~ ~2 ~1 #re8portals:frame/re8_dimension if block ~ ~-1 ~ #re8portals:air if block ~ ~-1 ~1 #re8portals:air if block ~ ~ ~1 #re8portals:air if block ~ ~1 ~ #re8portals:air if block ~ ~1 ~1 #re8portals:air positioned ~ ~-1 ~ align xyz run function re8portals:activate/create/re8_dimension/z
# South
execute if block ~ ~-2 ~ #re8portals:frame/re8_dimension if block ~ ~-2 ~-1 #re8portals:frame/re8_dimension if block ~ ~-1 ~-2 #re8portals:frame/re8_dimension if block ~ ~-1 ~1 #re8portals:frame/re8_dimension if block ~ ~ ~-2 #re8portals:frame/re8_dimension if block ~ ~ ~1 #re8portals:frame/re8_dimension if block ~ ~1 ~-2 #re8portals:frame/re8_dimension if block ~ ~1 ~1 #re8portals:frame/re8_dimension if block ~ ~2 ~ #re8portals:frame/re8_dimension if block ~ ~2 ~-1 #re8portals:frame/re8_dimension if block ~ ~-1 ~ #re8portals:air if block ~ ~-1 ~-1 #re8portals:air if block ~ ~ ~-1 #re8portals:air if block ~ ~1 ~ #re8portals:air if block ~ ~1 ~-1 #re8portals:air positioned ~ ~-1 ~-1 align xyz run function re8portals:activate/create/re8_dimension/z
# East
execute if block ~ ~-2 ~ #re8portals:frame/re8_dimension if block ~-1 ~-2 ~ #re8portals:frame/re8_dimension if block ~1 ~-1 ~ #re8portals:frame/re8_dimension if block ~-2 ~-1 ~ #re8portals:frame/re8_dimension if block ~1 ~ ~ #re8portals:frame/re8_dimension if block ~-2 ~ ~ #re8portals:frame/re8_dimension if block ~1 ~1 ~ #re8portals:frame/re8_dimension if block ~-2 ~1 ~ #re8portals:frame/re8_dimension if block ~ ~2 ~ #re8portals:frame/re8_dimension if block ~-1 ~2 ~ #re8portals:frame/re8_dimension if block ~ ~-1 ~ #re8portals:air if block ~-1 ~-1 ~ #re8portals:air if block ~-1 ~ ~ #re8portals:air if block ~ ~1 ~ #re8portals:air if block ~-1 ~1 ~ #re8portals:air positioned ~-1 ~-1 ~ align xyz run function re8portals:activate/create/re8_dimension/x
# West
execute if block ~ ~-2 ~ #re8portals:frame/re8_dimension if block ~1 ~-2 ~ #re8portals:frame/re8_dimension if block ~2 ~-1 ~ #re8portals:frame/re8_dimension if block ~-1 ~-1 ~ #re8portals:frame/re8_dimension if block ~2 ~ ~ #re8portals:frame/re8_dimension if block ~-1 ~ ~ #re8portals:frame/re8_dimension if block ~2 ~1 ~ #re8portals:frame/re8_dimension if block ~-1 ~1 ~ #re8portals:frame/re8_dimension if block ~ ~2 ~ #re8portals:frame/re8_dimension if block ~1 ~2 ~ #re8portals:frame/re8_dimension if block ~ ~-1 ~ #re8portals:air if block ~1 ~-1 ~ #re8portals:air if block ~1 ~ ~ #re8portals:air if block ~ ~1 ~ #re8portals:air if block ~1 ~1 ~ #re8portals:air positioned ~ ~-1 ~ align xyz run function re8portals:activate/create/re8_dimension/x
```
`top.mcfunction`
```
# 查看我们传送门头部是否有对应的方块
# North
execute if block ~ ~-3 ~ #re8portals:frame/re8_dimension if block ~ ~-3 ~1 #re8portals:frame/re8_dimension if block ~ ~-2 ~-1 #re8portals:frame/re8_dimension if block ~ ~-2 ~2 #re8portals:frame/re8_dimension if block ~ ~-1 ~-1 #re8portals:frame/re8_dimension if block ~ ~-1 ~2 #re8portals:frame/re8_dimension if block ~ ~ ~-1 #re8portals:frame/re8_dimension if block ~ ~ ~2 #re8portals:frame/re8_dimension if block ~ ~1 ~ #re8portals:frame/re8_dimension if block ~ ~1 ~1 #re8portals:frame/re8_dimension if block ~ ~-2 ~ #re8portals:air if block ~ ~-2 ~1 #re8portals:air if block ~ ~-1 ~ #re8portals:air if block ~ ~-1 ~1 #re8portals:air if block ~ ~ ~1 #re8portals:air positioned ~ ~-2 ~ align xyz run function re8portals:activate/create/re8_dimension/z
# South
execute if block ~ ~-3 ~ #re8portals:frame/re8_dimension if block ~ ~-3 ~-1 #re8portals:frame/re8_dimension if block ~ ~-2 ~-2 #re8portals:frame/re8_dimension if block ~ ~-2 ~1 #re8portals:frame/re8_dimension if block ~ ~-1 ~-2 #re8portals:frame/re8_dimension if block ~ ~-1 ~1 #re8portals:frame/re8_dimension if block ~ ~ ~-2 #re8portals:frame/re8_dimension if block ~ ~ ~1 #re8portals:frame/re8_dimension if block ~ ~1 ~ #re8portals:frame/re8_dimension if block ~ ~1 ~-1 #re8portals:frame/re8_dimension if block ~ ~-2 ~ #re8portals:air if block ~ ~-2 ~-1 #re8portals:air if block ~ ~-1 ~ #re8portals:air if block ~ ~-1 ~-1 #re8portals:air if block ~ ~ ~-1 #re8portals:air positioned ~ ~-2 ~-1 align xyz run function re8portals:activate/create/re8_dimension/z
# East
execute if block ~ ~-3 ~ #re8portals:frame/re8_dimension if block ~-1 ~-3 ~ #re8portals:frame/re8_dimension if block ~1 ~-2 ~ #re8portals:frame/re8_dimension if block ~-2 ~-2 ~ #re8portals:frame/re8_dimension if block ~1 ~-1 ~ #re8portals:frame/re8_dimension if block ~-2 ~-1 ~ #re8portals:frame/re8_dimension if block ~1 ~ ~ #re8portals:frame/re8_dimension if block ~-2 ~ ~ #re8portals:frame/re8_dimension if block ~ ~1 ~ #re8portals:frame/re8_dimension if block ~-1 ~1 ~ #re8portals:frame/re8_dimension if block ~ ~-2 ~ #re8portals:air if block ~-1 ~-2 ~ #re8portals:air if block ~ ~-1 ~ #re8portals:air if block ~-1 ~-1 ~ #re8portals:air if block ~-1 ~ ~ #re8portals:air positioned ~-1 ~-2 ~ align xyz run function re8portals:activate/create/re8_dimension/x
# West
execute if block ~ ~-3 ~ #re8portals:frame/re8_dimension if block ~1 ~-3 ~ #re8portals:frame/re8_dimension if block ~2 ~-2 ~ #re8portals:frame/re8_dimension if block ~-1 ~-2 ~ #re8portals:frame/re8_dimension if block ~2 ~-1 ~ #re8portals:frame/re8_dimension if block ~-1 ~-1 ~ #re8portals:frame/re8_dimension if block ~2 ~ ~ #re8portals:frame/re8_dimension if block ~-1 ~ ~ #re8portals:frame/re8_dimension if block ~ ~1 ~ #re8portals:frame/re8_dimension if block ~1 ~1 ~ #re8portals:frame/re8_dimension if block ~ ~-2 ~ #re8portals:air if block ~1 ~-2 ~ #re8portals:air if block ~ ~-1 ~ #re8portals:air if block ~1 ~-1 ~ #re8portals:air if block ~1 ~ ~ #re8portals:air positioned ~ ~-2 ~ align xyz run function re8portals:activate/create/re8_dimension/x
```
#### 在`activate`包中新建`create`包 -> `create`包中新建以我们维度名称命名的包`re8_dimension` -> 包中新建两个功能文件`x.mcfunction`、`z.mcfunction`
`x.mcfunction`
```
# 填充传送方块
fill ~ ~ ~ ~1 ~2 ~ minecraft:moving_piston