File Manager

Published by Goldorion on
Supported MCreator versions
2024.1
Tags / plugin type
Procedures
Variables
Icon
Downloads:
5952
Upvotes: 195
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

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.10

* [#48] Add a new parameter to write lines at the end of TXT files
  * Note: Existing workspaces will get a build error due to the missing parameter. Previous behaviour was FALSE.
* [Bugfix #62] Write Json object caused a build error due to a missing import (again)

5.9.1

* [Bugfix #61] Some procedure blocks could cause build errors due to a missing import
* Added Persian language support

5.9

* Updated to MCreator 2024.1.15713
* Added support for NeoForge 1.20.4
Project members
Lead developer
License
GNU Lesser General Public License version 2.1 (LGPLv2.1)

Plugin downloads
File Manager 5.10 - file-manager_1.zipUploaded on: 04/23/2024 - 16:43   File size: 81.13 KB

Comments

Can I make new recipe JSON file and paste it into the data folder of the mod, or i need to create a datapack and paste the generated files there?

Copy url to file still doesn't seem to be fixed, putting in the code block in a procedure makes the code not update at all like before :/

Can I unzip a zip file in the mod(.jar file) to .minecraft file when i load the game? I have tried, but I don't know if it was my mistake or if it doesn't support it

can this read a recipe .json in this type of format:
-------------------------------------------------------------------------------------------------
{
"type": "ls_furniture:carpentry",
"ingredients": [
{
"item": "minecraft:oak_planks"
},
{
"tag": "ls_furniture:emptyslot"
},
{
"item": "ls_furniture:oak_bark"
},
{
"tag": "ls_furniture:emptyslot"
},
{
"item": "ls_furniture:saw"
}
],
"output": {
-------------------------------------------------------------------------------------------------
This code is from my mod, atm its just to allow JEI to read my recipe. But all the recipes are done through procedures. im basically wondering If it can read it so then i can compare with the slots for the crafting result??

you cant have multiple keys by same name (item), look at how vanilla and mods do their recipes
```
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"#f#",
"###"
],
"key": {
"#": {
"tag": "minecraft:stone_crafting_materials"
},
"f": {
"item": "minecraft:flint"
}
},
"result": {
"item": "minecraft:furnace"
}
}
```
Oh and also the plugin doesnt allow arrays, so you cant really have [
"###",
"#f#",
"###"
]
Youd have to play around it, maybe like this:
```
{
"type": "ls_furniture:carpentry",
"keys": {
"item1": {
"item": "minecraft:oak_planks"
},
"item2": {
"tag": "ls_furniture:emptyslot"
},
"item3": {
"item": "ls_furniture:oak_bark"
},
"item4": {
"tag": "ls_furniture:emptyslot"
},
"item5": {
"item": "ls_furniture:saw"
}
},
"result": {
"item": ""
}
}
```

How? Ihave the same issue like GeckoGamer101, and i am using your JEI plugin, but i can't find nothing like procedure for result item. Can you help me please? I thing the File manager is a good for it, but i am making it on older version, so i can't use it.

Would it be possible with the gson library to make it be able to get key's of nth element?
So lets say I loop through a json object and I want to get the first elements key
Because id like to ease the use of my config, instead of doing:
```
"item1": {
"name": "minecraft:gravel",
"amntPerProcess": 8,
}
```
Id like to do:
```
"minecraft:gravel": {
"amntPerProcess": 8,
}

Well yeah, great plugin, but how to actually properly make a new config file at start and not do "A block is broken"
Like it doesnt work with "Mod loaded on server-side" because it bugs out not making a proper file closing, its missing an "}" at the end and also breaks any formatting of the file flattening all tabs (and I suck at Java so I dont wanna attempt using this in code, couldnt properly fix it so far)

Yeah actually even just creating a "file" variable breaks it the same way as doing any more with the procedure, while "Mod loaded on server-side" is being used as the global trigger
Lookin like this:
```
import java.io.File;

public class GenerateConfigProcedure {
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, value = {Dist.DEDICATED_SERVER}) public class GenerateConfigProcedure {
@SubscribeEvent public static void init(FMLDedicatedServerSetupEvent event) {
execute();
}
public static void execute(
) {
File file = new File("");com.google.gson.JsonObject mainJsonObject = new com.google.gson.JsonObject();
}
}
HERE SHOULD BE ANOTHER ENDING BRACKET
```

perhaps start by stating which version of the Plugin, what version of MCreator and what generator version you using? I've been using this plugin (v5.7.3) for quite a while now and have no issues with it for Forge 1.20.1, MCreator 2023.3 and 2023.4 as well as older versions.

True, my bad, but its just not too well explained how to properly implement the basic saving; which in my opinion should probably be as soon as the mod is loaded on the server-side (depending on the mod)
In the screenshot its just an empty procedure and in the preview video its on "A block is broken" like just why

I am using 5.7.3 on 2023.3 with the Fabric loader, should have probably tested on Forge

Alright so its not a Fabric specific issue, it does a similar thing on Forge, doesnt flatten the file but it still messes with the formatting missing a } at the end
I uploaded some screenshots to imgur https://imgur.com/a/AAHNjGq