Skip to main content

Minecraft utility calculations for blocks, chunks, and more

Project description

mcpack is just what you need to help with your Minecraft calculations and those model builds you've been thinking about. It lets you convert blocks to meters, calculate which chunk each item falls into, how many stacks you need, areas, volumes, and even simulated circumferences. It's a pleasure to plan and design constructions, both in-game and in the real world!

Installation

To install this package, once it's available on PyPI, just do this:

pip install mcpack

Or, if you prefer, you can clone it and use it directly from your machine:

git clone https://github.com/youruser/mcpack. git
cd mcpack
pip install .

Basic Use

import mcpack

# How many stacks do I need to store 150 items?
print(mcpack. calcstuck(150)) # 2

# In which chunk is block number 45?
print(mcpack. calcchunk(45)) # 2

# Convert 10 blocks to real-size meters (with a scale of 20)
print(mcpack. realsize(10, 1)) # 200

# Calculate how many blocks you need for 100 real-size meters (scale 1)
print(mcpack. blocksize(100, 1)) # 5

# Calculate the volume of a 10x5x3 block structure
print(mcpack. blockvolume(10, 5, 3)) # 150

# Calculate how many blocks you need for a circle with a radius of 8
print(mcpack. circumference_blocks(8)) # 50

# Calculate the real area of ​​a square with 10 blocks per side (scale 20)
print(mcpack. square_area_real(10)) # 40000

Included Functions

  • calcstuck(items): Tells you how many full stacks you need for a given number of items.
  • calcchunk(blocks): Gives you the chunk number a block is located in.
  • realsize(blocks, scale): Converts blocks to real-world meters, taking into account the scale.
  • blocksize(meters, scale): Converts real-world meters to blocks, depending on the scale you use.
  • blockvolume(length, width, height): Calculates the total volume in blocks.
  • circumference_blocks(radius): Calculates the number of blocks needed to simulate a circumference.
  • square_area_real(blocks_side, scale=20): Calculates the real-world area of ​​a square in meters.

License

This project is released under the MIT License. See the LICENSE file for full details.


Do you have an idea or would you like to contribute? Don't be shy and open an issue or send a pull request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mccalctools-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file mccalctools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mccalctools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for mccalctools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 841df567ac66d326e00b5724df754a3d3846d90a61d8fcb5cb3f1be7142bddd2
MD5 6d8fe8de0384d99d4bf3b3367a2e1e82
BLAKE2b-256 2ca3b0e5d2aca9fc465fe4fa7b9d27117cdd02b0748985e0dc485a234281f398

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page