Comments (5)
@LucasDower
Schematic already uses a format that is a bit similar to JSON: https://www.reddit.com/r/Minecraft/comments/k3rrce/is_there_a_way_to_convert_schematic_files_into/
Only repo I found while googling it is:
https://github.com/MicleBrick/Schematic2Json
Which isnt very serious...
Also there are other people asking that question:
https://www.reddit.com/r/MinecraftHelp/comments/tzv3z1/is_there_a_way_to_convert_minecraft_schematics/
But as you can see there are no answers.
As of now it doesnt seem that JSON is used for storing minecraft structure nor that there is a norm for that kind of file. This means that there is no relevant norm (approved or used) that we could choose to implement.
@Dkavila
If you need to have the structure formated in a JSON file for your specific needs, I suggest you fork this repo and create your own norm for that kind of format. This will also provide you with more freedom & knowledge when it comes to programming your parser (to read the JSON files you'll make).
from objtoschematic.
Sure I can add a JSON exporter, is there a particular format you have in mind or just access to block names and their positions?
from objtoschematic.
I imagine the main benefit of a JSON exporter is that it's the easiest to parse, any popular language has JSON libraries so if somebody wants to use the block data somewhere it's a lot easier to load a JSON file than try decipher any of the NBT-based exporters.
Like @0-zen said, it's just about deciding the format. The main concern is that (1) JSON is text-based so encoding is slow, and (2) there's potentially tens of thousands of blocks and JSON is quite verbose so the file could be massive.
We could export something simple like:
[
{ "x": 0, "y": 0, "z": 0, "block": "minecraft:stone" },
{ "x": 1, "y": 8, "z": 7, "block": "minecraft:bedrock" },
{ "x": 2, "y": 1, "z": 4, "block": "minecraft:cobblestone" },
...
]
which would be super implement and super simple for an external program to read but is not very suitable for massive builds.
Alternatively we could go down a similar approach to the .gltf format is a JSON file with block data buffers stored as base64 encoded strings.
from objtoschematic.
I feel that if we use base64 for encoding, we are going to target people who already know how to program a bit. We might as well create our own binary format, which will be much more compact. Or we could inspire from binary PLY files, which have a structure that starts with a short ASCII header and then binary body.
from objtoschematic.
Added 'Indexed JSON' and 'Uncompressed JSON' exporters.
from objtoschematic.
Related Issues (20)
- Add chunked exporting to the structure blocks exporter HOT 2
- Unable to export a schem with exceeding approximately 300 Height HOT 1
- problem with TGA images. HOT 1
- Material textures in the Materials section are not correctly disabled HOT 1
- Repeat texture coordinates are somewhat broken
- Some parts of the model do not render unless the camera is moved
- Refactor texture handling, allow .png, .jpg, .bmp, .gif, .webp HOT 1
- Voxel overlap does not work as intended
- Various disabled states for material components are missing styles
- .Vox exporter for voxel meshes
- Collection of objects imported with GLB ignore world positions
- npm package/API HOT 4
- Adding modded blocks
- No human-readable error when assigning blocks with empty block palette
- Error when exporting a block mesh to .litematic that uses a single block
- No tooltips for block palette buttons
- Freeze when click 'Load Mesh' with no mesh selected
- After recoloring the mesh an option to donwload the new recolored model.
- STL support and height increase
- Add Create compatible schematics
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from objtoschematic.