Skip to content

Commit

Permalink
added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
WoodieMaster committed Nov 22, 2023
1 parent 5f4a8d2 commit 940e6a9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Image to MC Scoreboards

This is a little program that converts images into mcfunction files, that generate the same image in minecraft scoreboard displays

## About
While watching [PhoenixSCLive](https://www.twitch.tv/phoenixsclive), where he used the same method to display images, I came up with the idea to automate it, and here it is!

## Overview
- The project is written in python 3.12
- The entire code is located in the main.py file
- Supports all common image formats (More details in the PIL package)
- The project converts the given image into a .mcfunction file that can be placed in a mc datapack to display the image in the scoreboard display
- The mc_test folder uses the image conversion to update the display to the item that you're currently holding in minecraft
- Used packages:
- [numpy](https://numpy.org)
- [PIL](https://pillow.readthedocs.io/en/stable/)


## Installation
Download the code from github.
In the future I might add the project to pip, but I this is not yet planned

## Usage
### main.py
Call the file with the following arguments (use - to ignore a specific argument):
- The path to the image you want to convert
- The output path (if this path is not given, it will print the code to the console instead of writing it to a file)
- The name of the scoreboard you want to use for display (defaults to "display")
- The alignment: true for left aligned and false for right aligned (defaults to false)
### test.py
Before running the file change the following variables:
- MC_VERSION defines the version of minecraft you want to get the images from
- WORLD defines the name of the world you want to put the datapack into
- DATAPACK is the name of the datapack where the display should happen

and move the datapack_example folder in the datapack folder of your world (you might rename the datapack)

**Important:**

This script will extract the version.jar file of the minecraft version you specified, when it wasn't already extracted. If you don't want that either extract it yourself or get the images from somewhere else
2 changes: 1 addition & 1 deletion mc_test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
APPDATA_PATH = os.getenv("APPDATA")
MC_VERSION = "1.20.3-pre2"
WORLD = "SnapShotTest"
DATAPACK = "display"
DATAPACK = "datapack_example"

IN_PATH_P1 = f"{APPDATA_PATH}/.minecraft/versions/{MC_VERSION}/{MC_VERSION}"
IN_PATH_COMPLETE = IN_PATH_P1 + "/assets/minecraft/textures/item/"
Expand Down

0 comments on commit 940e6a9

Please sign in to comment.