Giter Site home page Giter Site logo

java2bedrock.sh's Introduction

Usage

Local

To run, simply:

./converter.sh MyResourcePack.zip

To run without settings prompts, use flags:

  • -w (true|false) whether or not to show the warning prompt
  • -m (pack_to_merge.mcpack) filename of Bedrock Edition resource pack in the same diretory to merge with result of the conversion
  • -a (attachable_material) material to use for attachables written by the script
  • -b (block_material) material to use for blocks written by the script
  • -f (https://somesite.com/fallback_pack.zip|null) URL of a Java Edition resource to use for fallback textures before the default pack
  • -v (default_asset_version) version of Minecraft Java Edition for which to pull default assets

For example:

./converter.sh MyResourcePack.zip -w "false" -m "MyBedrock.mcpack" -a "entity_alphatest_one_sided" -b "alpha_test" -f "null" -v "1.18.2"

Item Icons

If you prepare 2D sprites for your 3D models, you can provide the converter with mappings for these sprites to be incorporated into item_texture.json and the exported Geyser mappings. To do so, simply include a file called sprites.json in the root of your Java resource pack. The format of this file is as follows:

{
    "leather": [
        {
            "custom_model_data": 1,
            "sprite": "textures/path/to/texture_in_bedrock_rp/texture1"
        },
        {
            "custom_model_data": 2,
            "sprite": "textures/path/to/texture_in_bedrock_rp/texture2"
        }
    ],
    "diamond_axe": [
        {
            "damage_predicate": 2,
            "unbreakable": true,
            "sprite": "textures/path/to/texture_in_bedrock_rp/texture3"
        }
    ]
}

When utilizing this feature, you should also use the merge feature to combine the converted pack with an existing Bedrock resource pack containing the specified sprite textures. If using the Github Actions based converter, simply provide a direct download URL of said Bedrock resource pack as done for the Java pack.

Github Actions

You may also run the converter through Github Actions in this repository by creating an issue with the Pack Conversion template. You are only required to enter the link to the Java pack, though the options described above may also be configured. Your pack will then be queued for conversion by Github Actions. After conversion is complete, the Github Actions bot will reply to your issue with a link to download your converted pack and associated mappings file. Included in the bundle is a behavior pack and addon to view the models in single player, as well as a configuration file containing the paths to the models converted from the Java resource pack and their corresponding identifiers in the Bedrock resource pack.

About

NOTICE: Due to MCPE-152191, any blocks that are larger than 1.9 blocks will not load. This is only relavent to those using the preview pack to display converted models in single player.

The script has been updated to handle parent models and 2D items. It will generate multiple sprite sheets for 3D models without repeating the inclusion of any given texture. 2D item textures will be copied over individually. Note that sprites for 3D items must be added manually.

Your script and resource pack zip file must be in the same directory. Ensure that this zip file is properly setup. It should not have a root directory. Your resource pack must also be formatted correctly, to vanilla specifications. By default, this script will download the default assets in order to generate texture atlases in cases in which you have utilized those. If you wish to use different default assets, you may specify this at the beginning. The default pack will then be downloaded after your specified assets, with your specified assets taking precedence. As long as you provide valid JSON, the script should output something you can use.

You may also specify an input bedrock pack to merge with the output assets produced by the converter. This should be in the same directory as the script and your input Java pack. Like the Java pack, ensure that it is compressed with no root folder. When prompted, type the file name of the input file, such as example_rp.mcpack. Merging of behavior packs is not currently supported.

The packs generated by this script can currently only be used in Bedrock Edition 1.16.210.59 and above. Please be sure to enable the experimental setting "Holiday Creator Features" on world generation. You'll probably also want to be in creative mode as that will be the only way to give yourself the blocks generated by the script. Here are the commands to obtain one of the items or place them in your head slot:

/give @p geysercmd:gmdl_xxxxxxx
/replaceitem entity @p slot.armor.head 0 geysercmd:gmdl_xxxxxxx

The xxxxxxx term corresponds to the short hash assigned to the model. These are written to config.json, which can be found in the target directory, along with packaged and non-packaged versions of the output assets. This will specify the corresponding item and nbt for each input predicate. The short hash is constructed by combining the predicate entry's item, custom model data, damage, and damaged predicates, taking the md5 hash of this string, and keeping only the first 7 characters. As a result, this hash value will remain the same across conversions.

Also note that this script requires:

It will exit if you fail to meet these dependencies. While the ultimate intention here is to import these via Geyser, the script currently generates a behavior pack so that you may view your converted models in Bedrock Edition. It also generates a mappings file compliant with Geyser's custom item mappings system.

Should you have any complaints about getting this to run because you "only use windows", do note that I was able to run this perfectly fine on a Mac running Parallels to run Windows to run WSL to run Ubuntu 20. Therefore, I am sure it is perfectly possible for you to get this working, regardless of your OS. I will gladly take such criticism only if you are willing to help develop this into a proper cross platform program.

Dependency Installation

Debian, Ubuntu, & Mint

sudo apt-get install moreutils jq imagemagick unzip zip nodejs uuid-runtime
npm i -g spritesheet-js

MacOS

brew install moreutils jq imagemagick unzip zip nodejs uuid-runtime
npm i -g spritesheet-js

RHEL, Fedora, & Centos

sudo yum install moreutils jq imagemagick unzip zip nodejs uuid-runtime
npm i -g spritesheet-js

Arch Linux

sudo pacman -S moreutils jq imagemagick unzip zip nodejs uuid-runtime
npm i -g spritesheet-js

Windows

Impossible; consider WSL.

Special Notes for WSL (Ubuntu)

In general, packages on WSL seem to be a little wonky, and sometimes jq-1.5 will be installed, which will not work. To manually install jq-1.6 on WSL, at least for Ubuntu:

wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && sudo chmod +x jq-linux64 && sudo mv jq-linux64 /usr/bin/jq

If you install spritesheet-js globally, but the script fails due to missing the dependency, ensure that the folder containing your global node modules is added to your path. If, after installing, which spritesheet-js returns no output, you may add global node modules to your path by:

echo "export PATH=$PATH:$(npm config --global get prefix)/bin" >> ~/.bashrc && source ~/.bashrc

java2bedrock.sh's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

java2bedrock.sh's Issues

[Pack]: https://file1.guizhanss.cn/cloudreve1/1/minecraft/resourcepacks/GuizhanCraftResources/GuizhanCraft-resources-2.1-prod.zip

Java Pack Direct Download URL

https://file1.guizhanss.cn/cloudreve1/1/minecraft/resourcepacks/GuizhanCraftResources/GuizhanCraft-resources-2.1-prod.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]:

[Pack]: customitems

Java Pack Direct Download URL

https://www.dropbox.com/s/hjp1jaf4psk3g3g/pack.zip?dl=1

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

1.19

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]: Nova

Java Pack Direct Download URL

https://github.com/xenondevs/NovaRP/releases/download/0.8/NovaRP.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]: https://raw.githubusercontent.com/FentisDev/PortalGun/master/resourcepacks/PortalGun-By-Fentis-1.0.0.zip

Java Pack Direct Download URL

https://raw.githubusercontent.com/FentisDev/PortalGun/master/resourcepacks/PortalGun-By-Fentis-1.0.0.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]:

Java Pack Direct Download URL

https://www.dropbox.com/s/5bkm6mfv5pqgmg6/Custom-Discs_v1-0_MAIN.zip?dl=0

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]:

Java Pack Direct Download URL

https://download.mc-packs.net/pack/a34776a1bebb55876886012cbf03d3578d1312bf.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

1.18.2

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]: https://mtvehicles.nl/resourcepack/download/MTVehicles_Pack_v0.2.0.zip

Java Pack Direct Download URL

https://mtvehicles.nl/resourcepack/download/MTVehicles_Pack_v0.2.0.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]:

Java Pack Direct Download URL

https://github.com/zimzaza4/QualityArmory-Resourcepack/archive/refs/tags/n.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]: guns

Java Pack Direct Download URL

https://www.dropbox.com/s/g5rkfdcmlax9w6a/QualityArmoryV2.0.2.zip?dl=1

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]:

Java Pack Direct Download URL

https://www.dropbox.com/s/2uxlc2130o3gf1s/CreeperNation.zip?dl=1

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]: Carpenter 2 Lol

Java Pack Direct Download URL

https://www.dropbox.com/s/rijhwvvkfz83vln/resources.zip?dl=0

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Bug]: items' ids are geyser_custom, not geysercmd

Conversion Issue Link

none

Expected Output

the custom items' ids are starting with geysercmd:xxxxx
can compatible imdabigboss's pr

Actual Output

items' ids are starting with geyser_custom:xxxx

Additional Context

No response

[Pack]:

Java Pack Direct Download URL

[CENSORED]

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

1.17.1

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]: bretcoolpack

Java Pack Direct Download URL

https://github.com/LunarEclipseStudios/Architects-Toolbox/releases/download/v1.0/Architects-Toolbox-v1.0-Data-Resource-Pack.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]:

Java Pack Direct Download URL

https://drive.google.com/uc?export=download&id=1nxaVTxLc3R2bT3Wkx3prYvGr3U9gkJ4-

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

1.18.2

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]:

Java Pack Direct Download URL

https://114514-1306946608.cos.ap-beijing.myqcloud.com/resource%20pack.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]: IAF

Java Pack Direct Download URL

https://www.dropbox.com/s/b87wuz0e0z5p0bs/furnituresplusfree.zip?dl=0

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

1.18.2

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]: TownyAlpha

Java Pack Direct Download URL

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

1.18.2

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]: https://cdn.discordapp.com/attachments/855106551144120350/983069071128018944/pack_9.zip.src.zip

Java Pack Direct Download URL

https://cdn.discordapp.com/attachments/855106551144120350/983069071128018944/pack_9.zip.src.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

1.18.2

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Bug]: Duplicate Custommodeldata value

Conversion Issue Link

#59

Expected Output

Because the custommodeldata value of different items may be the same, and they are named according to the converted item id, it is easy to cause the item to be named the same. It is recommended to add the original item name to the converted item id
for example:
gmdl_114514 (original) => gmdl_iron_sword_114514 (workaround)

Actual Output

/

Additional Context

i use machine translate

[Pack]: Coaster Con

Java Pack Direct Download URL

https://github.com/Coasters-Crafters/resource-pack/releases/download/1.1.28/CoasterConResoucePack-1.1.28.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

https://ci.opencollab.dev/job/GeyserMC/job/GeyserOptionalPack/job/master/lastSuccessfulBuild/artifact/GeyserOptionalPack.mcpack

Default Assets Version

1.18.2

Block Material

alpha_test

Attachable Material

entity_alphatest_one_sided

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]: https://mtvehicles.nl/resourcepack/download/MTVehicles_Pack_v0.2.0.zip

Java Pack Direct Download URL

https://mtvehicles.nl/resourcepack/download/MTVehicles_Pack_v0.2.0.zip

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

[Pack]:

Java Pack Direct Download URL

CarpenterCraft-mc1.16.3-resources

Default Pack Direct Download URL

No response

Bedrock Merge Pack Direct Download URL

No response

Default Assets Version

No response

Block Material

No response

Attachable Material

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct. I have permission to use all assets I have linked to within this form.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.