r/MinecraftCommands • u/BowlerNext589 • 1d ago
Help | Java 26.3 Need help fixing a 3D Langton's Ant/Conways Game of Life style project using a datapack in Minecraft [java] 26.3
https://drive.google.com/file/d/1TjRwfA5JOjtH3x7RHVl7uoeoHSPn4oTQ/view?usp=sharingVideo that completely inspired the project: https://www.youtube.com/watch?v=Wj47IQfvU20
All heavily made by AI as I have zero coding experience but love predictable randomness so I apolagise about that.
I'm trying to recreate or copy this video in a way where I can go to the datapack, edit something from saying up to down, or left to right super easily in order to get a new pattern, this will be to represent chaos theory and cause its really cool
The entity is preferably an enderman with NoAI:1b. All movement happens through commands and teleportation (/tp), rather than normal entity movement or gravity as i've learnt NoAI:1b kinda removes gravity.
The entity follows these five rules:
One-block-high wall directly ahead: Destroy the block underneath the itself and teleport itself down one block. (Or even better implement gravity in some way to a NoAI:1b entity. This makes the wall effectively two blocks high relative to the ant. Keep facing the same direction. See image below


Wall two or more blocks high: Climb upwards until the entity can get over it with a single jump and forward once. Excluding that last example every upward teleport must place a support block underneath the ant. Then teleport forward onto the top and reassess the terrain. See image below


Level ground: Remove the block underneath the ant and teleport down one block. Turn left exactly 90 degrees. See image below


One-block drop ahead: Teleport up one block, place a support block underneath, and turn left 90 degrees. See image below


Drop of two or more blocks ahead: Teleport up one block, place a block underneath, and continue straight without turning. See image below


- The entity must should relative to its current facing direction, not fixed world coordinates if possible.
- It must check that both the space for its feet and the space for its head are clear before moving forward.
- It must correctly distinguish between a one-block wall, a two-block wall, level ground, a one-block drop and a deeper drop.
- Only one rule should execute at a time.
- After each action, it must reassess the terrain before deciding what to do next.
- It must not take fall damage unless through teleportation fall damage is not really gonna happen as I cant see it happening anyway due to No Ai being immune to gravity.
- All movement must be controlled through teleportation.
I've tried making this with multiple .mcfunction files, but I've run into problems with terrain detection, relative coordinates, and functions triggering multiple rules in the same tick. For example, the ant sometimes gets stuck repeatedly placing and destroying blocks beneath itself.
I'm open to rebuilding the datapack from scratch if necessary.
Could someone help me build a reliable system for this?
Video that inspired the project: https://www.youtube.com/watch?v=Wj47IQfvU20
Any help whatsoever would be extremely appreciated
1
u/Ericristian_bros Command Experienced 1d ago
To stop the movement
Backup your world, because recursive functions can cause crashes if something goes wrong (fall function and rule 2).
I haven't tested the pack, so typos are possible, let me know if something does not work as expected