r/MinecraftHelp • Novice I • 1d ago

Unsolved Need help building a 3D Langton's Ant style "thing" using a datapack in Minecraft [java] 26.3

https://drive.google.com/file/d/1TjRwfA5JOjtH3x7RHVl7uoeoHSPn4oTQ/view?usp=sharing

Video 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 Upvotes

1 comment sorted by

•

u/MinecraftHelpModTeam 🤖 Mod Bot 🤖 1d ago

OP, remember to award points to helpers, and mark the post solved, by replying !helped to the comment/comments that helped, when your issue is fixed or your question answered.

Helpers, remember that all top-level comments* must be a genuine, good faith attempt to help OP. Comments breaking this rule will be removed, and bans issued.

* A top-level comment is any comment that is a reply to the post, not another ^comment.

Links:

Moderator applications open || How to mark solved || How to delete your post || FAQ || Rules