Data Packs Simple

Collatz Conjecture in Minecraft

  • 215 views 1 today
  • save_alt 4 downloads
Compatibility
Minecraft 1.21
Changes include
  • Functions
  • 3
  • 0
  • 5
Samster6868
Lvl 28Expert Crab
3
Compatible with Minecraft 1.21.10.

You can use this datapack to count the steps from a given number down to 1 using the rules of the Collatz Conjecture. Below is a simplification of the rules.

1. Start with any positive integer.
2. If it is even, divide it by 2.
3. If it is odd, multiply it by 3 and add 1.

After loading the datapack, use "/trigger collatz_input set <number>" to start the calculation. Each step is sent to the text chat, and then it generates a report. The report has five numbers: the starting value, the steps from the starting value to the maximum, the maximum, the steps from the maximum to one, and then the total amount of steps. There is also a simple report on the scoreboard sidebar.

Enjoy!

1 Update Logs

Patch v1.0.1 : by Samster6868 11/23/2025 1:28:02 pmNovember 23, 2025 @ 6:28 pm UTC

  • Added a condensed report in chat once the calculations are complete.
  • Added a couple extra values.
  • Adjusted colors.

More like this

  Have something to say?

mega7
11/30/2025 5:45 am
Level 49 : Master Muffin Engineer
I bet you're a soviet agent tryna get someone to solve it so you could steal the solution, I just know it
2
Samster6868
12/05/2025 3:16 pm
Level 28 : Expert Crab
Don't blow my cover!
1
player_0
11/24/2025 7:15 pm
He/Him • Level 5 : Apprentice Crafter
...why
2
Samster6868
11/26/2025 7:53 am
Level 28 : Expert Crab
Great question.
2
MinhoCreates
11/23/2025 7:07 pm
Level 64 : High Grandmaster Engineer Dinosaur
Very cool!! 🤠
2

Welcome