File Manager

Published by Goldorion on
Supported MCreator versions
2023.4
2024.1
Tags / plugin type
Procedures
Variables
Icon
Downloads:
5334
Upvotes: 185
Plugin forum topic
About the plugin

File Manager is a plugin adding new procedure blocks allowing you to create and read your files! 

File Types

  • JSON
  • TXT (simple file reader/writer)
  • ZIP (5.7+)

Important Information

  • This version supports Forge 1.19.4 and 1.20.1 and Fabric 1.20.1
  • 2024.1.15713 ONLY

https://storage.ko-fi.com/cdn/brandasset/kofi_button_blue.png

The 2 following examples require File Manager 5.0 or after.

Create a JSON file

Create a json file

Read a JSON file

Read a JSON file

I made a tutorial covering this here.

Credits/License

Tutorial by NorthWestTrees

Tutorial on sub-JSON objects by NorthWestTrees

Tutorial by Cursed Warrior

Icon by Tobi-Wan#0482

Licensed under the GNU Lesser General Public License, version 2.1  

  • Appropriate credit must be provided to the creators and maintainers of this plugin.
  • Forked versions of this plugin must be distributed under the same license as this with attribution if distributed.
  • Changes must be stated if any modified works are to be distributed.
  • Under no circumstances you can state that the original creator endorses modified works.

Changelog

To see a complete changelog of the plugin, check this file.

5.9

* Updated to MCreator 2024.1.15713
* Added support for NeoForge 1.20.4

5.8

* Removed support for Forge 1.18.2, 1.19.2
* Removed support for Fabric 1.19.2
* Re-organized File Manager's categories to use the new parent/children category system
* [#51] Add a Remove JSON property
* [#54] Add Get client's directory
* [#58] Add Get JSON property name at index
* [Bugfix #50] Is JSON object empty caused a build error
* [Bugfix #52] Copy url to file didn't work correctly
Project members
Lead developer
License
GNU Lesser General Public License version 2.1 (LGPLv2.1)

Plugin downloads
File Manager 5.9 - MCreator 2024.1.15713 ONLY - file-manager.zipUploaded on: 04/10/2024 - 13:55   File size: 79.46 KB
File Manager 5.8 - MCreator 2023.4 - file-manager.zipUploaded on: 02/08/2024 - 02:45   File size: 65.32 KB

Comments

since I cannot add screenshots here, take a look at the git hub issues report: https://github.com/Goldorion/File-Manager-MCreator/issues/11 where I provided screenshots and what was done to get it working. Yes, working on latest update as well :-)
-Steve

Okayy,
But im pretty sure there's still no option to check which file doesn't exist (that if condition). It'd be good add it cause right now this condition is pretty useless (before creating file)

Yes that is the case. There isn't a SET option for FileManager variables so the only way I found was to unlock the code for the procedure and update: File myFile = new File("serverbasicsconfig.json");
with the actual name. This sets the filename before checking if it exists or not. Not ideal, but a workaround for now. Just have to check it in/out again when making changes to that procedure which is a pain initially.

Okay, we are wrong tho. There is a block to set file variable, just it's name is kinda misleading.

This block is "Create the file with name located at directory".

It creates a variable File and puts the directory into it.

When u used read blocks in procedure it checks if file exists in the directory and if it doesn't exist, it creates it. If it exists it does nothing, you have full access to info inside it.

Heya, I'm using a Gobal Variable and II have the "not Does Exist" if statement in the beginning but it keeps being reset like it's rewriting the config on every startup (I'm using Mod loaded in the game as my event trigger)

I ran into the same issue and couldn't find any way to set the variable so that the file not found message would go away. I used a variable for the filename (in the example above and my use case). Details are in Issue-11 on Github. In short, I got the logic to read/write working be editing the code to explicitly set myFile variable in java: File myFile = new File("serverconfig.json");

Once I had that done first, then everything worked fine after that. I tried using a global variable to set the value but there wasn't any option in File Manager to use an element that allows setting of a variable's value.

Hi Goldorion - thank you very much for creating this long desired plugin!!! I have several use cases that I want to use this for and at looks like we're on track to getting there soon. Nice work.

Hello. In the example you can see how to write to a file and then read from it. I don't understand how to only read vfrom it. Where do I say to the code where to look for the file to read?

I have 2 issues, I can't edit any boolean subgson's since they keep being overwritten and I can't access them outside the main prodecure since its a Local Variable and whenever I try to use a Public one it just gives me errors, Like I want to access the data if the value is true or false in another procedure but I can't since it's a local one. I followed your picture guide for gson

can you plz post an example of how to only read from a file. thank you.