Posted February 20, 20223 yr I am looking for a way to read information about the block in the world and save that information to a file system. Later on, I would like to place that block back in the world based on the information from file system. 1) I can access BlockState but I am not sure what would be the proper identifier for specific block state? E.g. if stairs are turned to the north, how would I access information about that specific state of the stairs? 2) For information about the type of block, I can use block.getRegistryName() - is that proper way to get string identifier for specific block? 3) ForgeRegistries.BLOCK.getValue accepts registry name of block. Is that a proper way to get instance of a block based on the registry name stored before? 4) Block class has stateById method that accepts Id. Is this proper way to get specific BlockState? If yes, how can I get the Id parameter? I have been struggling with this for a while so any help would be appreciated.
February 20, 20223 yr Author Thank you @diesieben07 , this was exactly what I was looking for. Regarding to best approach to write to file system - can you please point me in the right direction, I would like to use Minecraft/Forge API if one is available. My plan is to have collected information exported in JSON format to file system.
February 20, 20223 yr Author I am trying to extract information about the specific structure into a JSON file that will be used as a template to reconstruct the structure through custom made block. When custom block is placed in the world, it will read information from JSON file and place blocks in the same exact order so that structure is reproduced. That's the idea. This is not going to be part of any publicly distributed mod. It's more of developer tool to export structures in a fast way. Edited February 20, 20223 yr by Adil Yilan
February 20, 20223 yr Author Because I am new to modding and I have no clue what WorldSavedData or Capability is - basically. So I have this block named PinpointerBlock that should be placed on three locations. When the block is activated on the blue position, it should read information about everything between and save it to JSON. That's the whole idea.
February 20, 20223 yr Author I need data outside of the running Minecraft instance. If I go with WorldSavedData - where will the data be located physically - as in which files/folders on disk drive?
February 20, 20223 yr Author Alright, that's enough information, I will dive into it. Thank you so much!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.