Started by
chickenjockey
on
Topic category: Help with Minecraft modding (Java Edition)
I need help with making a block that creates a border that stretches very tall and deep that prevents players and mobs from going over or under it, similar to the border block in Minecraft Education Edition. How do I do that?
Create a custom barrier/border block. Place the initial block which will then replace all air blocks above and below it with your custom barrier block. Use an nbt or synced data to store the xyz of the origin block. Then the barrier blocks will then check whether the origin block still exists at xyz, if not replace itself with air. Make them all unbreakable. You can additionally make it check for whether any blocks are broken eg become air and replace them with your barrier block. However all this will probably cause performance drops. At least on the initial placement.
To check all blocks in a column:
set local variable (height) to (bottom y coord of dimension eg -64)
while (height) < (height of dimension)
get block at x (height) z = air, set block at x (height) z to custom_barrier
set (height) to get (height) +1