This is an updated and improved version of the File Manager plugin by Goldorion, which I will continue to maintain in his absence.
New procedure blocks introduced to the plugin
Changelog
v6.8
-Added the delete file procedure block
v6.7
-Added support for MCreator 2025.2
-Fixed text file write line procedure block build error
v6.6
-Added support for MCreator 2024.4
v6.5
-Ported to MCreator 2024.3 and neoforge 1.21.1
-Fixed json array getter procedures causing build error when using variables to get entries
v6.4.1
-Fixed json arrays not working in forge 1.20.1
v6.4
-Added global session variables for json objects and arrays
-Fixed the file global session variable causing build errors
v6.3
-Added 2 procedure blocks to read datapack json files
-Fixed the url to file procedure
v6.2
-Added 5 new procedure blocks to check the data type of json properties
v6.1
-Added new procedure block, file from path
v6.0
-Ported to 2024.2 and neoforge 1.20.6
-Added a directory iterator procedure
-Added the json array variable type
-Added new procedure blocks to use json arrays
Comments
Hi, I've found the solution to this through ChatGPT LOL.
Make a custom code snippet block, and make a variable named "FolderName"
Put this into the snippet:
MinecraftServer server = ServerLifecycleHooks.getCurrentServer();
FolderName = server.getWorldPath(LevelResource.ROOT).getParent().getFileName().toString();
After that, the variable you just created, aka "FolderName" will be your actual world folder name.
Suggestion to add "delete file" block, NerdyMix has already added this block to it's 1.5.2 version.
https://github.com/Tucky143/NerdyMix/issues/10
In the github issue where i originally suggested this change to Nerdymix's author, I also described exactly how to implement it.
I think I’m already doing that. I’ve noticed that Nerdy’s Curios API doesn’t support MCreator 2024.4 and above, so I’m rewriting everything in his style while also adding some new features. Hopefully it’ll work well. If possible, I’ll upload it here once it’s done.
Nerdy, I need help! I think there is a bug. the "For each line of (file) get the text as (string iterator)" block does not work at all. I did the following:
1. Event Trigger
Set (File Variable) to (file named (name.txt) in directory (join (game directory) and (/config/name))
For each line of (file) get the text as (String Iterator)
do 2. (send to chat to all players (String Iterator))
Output: ""
Nothing gets sent to the chat when I run it.
Nerdy, I need help! I think there is a bug. the "For each line of (file) get the text as (string iterator)" block does not work at all. I did the following:
1. Event Trigger
do 2. (send to chat to all players (String Iterator))
Output: ""
Nothing gets sent to the chat when I run it.
Is there a way how I can delete created files completely? A file is created in my mod, but the player should be able to delete the file again. I don't just want to empty the file but delete it completely so that no unnecessary disk space is wasted. Is there a way to do this?
> Task :compileJava FAILED
C:\Users\Jannick\MCreatorWorkspaces\server_trading_system\src\main\java\net\mcreator\servertradingsystem\procedures\WriteConfigProcedureProcedure.java:89: error: incompatible types: possible lossy conversion from long to int
subObject.addProperty(mainObject.keySet().stream().toList().get(Math.round(index)), mainObject.get(mainObject.keySet().stream().toList().get(Math.round(index))).getAsDouble());
^
C:\Users\Jannick\MCreatorWorkspaces\server_trading_system\src\main\java\net\mcreator\servertradingsystem\procedures\WriteConfigProcedureProcedure.java:89: error: incompatible types: possible lossy conversion from long to int
subObject.addProperty(mainObject.keySet().stream().toList().get(Math.round(index)), mainObject.get(mainObject.keySet().stream().toList().get(Math.round(index))).getAsDouble());
I couldn't find any issue tracker, so I'm reporting it here.
The "Get current world's name" block gets world's name, as expected. The issue comes when the world's folder is named differently than the world itself (example: world's name is New World, but it's folder is New World(1).) This creates an issue when you try to have world persistent files, as it saves into wrong save.