Script for searching blocks in .mcwolrd using Java

Started by migushev on

Topic category: Help with Minecraft modding (Bedrock Edition)

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Script for searching blocks in .mcwolrd using Java

I need to write a script using Java that parses Minecraft Bedrock Edition level which is in .mcworld file and searches for certain blocks and give its coordinates. I decompressed .mcworld but I have a problem with reading level data. 

Level data in Bedrock Edition in NBT format. 

But I can’t find a way to read level data and get info about blocks, what coordinates and what type of block it is.


I use Java.


Maybe you guys can give me a hint, what Java library to use. And how can I parse level of Bedrock edition without converting into Minecraft Java Edition.


The world that I want to parse is this one https://disk.yandex.ru/d/zPjyNZIJJ1ravA


Thanks for you advice guys

Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not sure if you can do…
Mon, 09/04/2023 - 14:30

I'm not sure if you can do that specific thing with Java. Probably because bedrock edition is made in C++. 

They do allow you to make scripts using JavaScript or TypeScript.

 

This is the Microsoft documentation for scripting https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/

And this is a very popular bedrock add-on wiki https://wiki.bedrock.dev/scripting/starting-scripts.html

Hope this helps!