How to use WorldEdit (or any mod) in your testing environment [Tutorial]

Started by Kuba4ful on

Topic category: User side tutorials

Last seen on 13:26, 1. Oct 2022
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to use WorldEdit (or any mod) in your testing environment [Tutorial]

Hi. Today I've spent 7 hours trying to use WorldEdit in my testing (mdk) environment to make structures, but now I've managed to make it work and wanted to share with you how to do it, in a simple three setp guide. (You can make it work with any mod that has it's deobf version online or is open source. You will just need to change a few lines in build.gradle file).

First of all, go to https://maven.enginehub.org/repo/com/sk89q/worldedit/ and find the version you're developing the mod for (in this tutorial I'll use 1.16.5 since it's the newest MCreator version). Remember that with MCreator we're using Forge, so the link you want to find will look like this: "worldedit-forge-mc*version*".

(Side note: Mods for 1.16.3 are compatible with 1.16.5, that's why there's no 1.16.5 in that directory).

Choose the version without "SNAPSHOT" at the end, because these versions may be unstable and may lead to crashes.

Now you will see a few jar files with very similar names. Download the one ending with "-dev", because this one is the deobfuscated (deobf) version.

(Explanation, no need to read it if you're not interested in it. Because it's easy to decompile java appliactions and see their source code, Mojang implemented obfuscations of names to make it harder for data miners. So for example a method called "generateChunk" (idk if there's really a method like that, I just made it up) after obfuscating would have a name "_gfdhg1434" (basically a random string). Forge testing environment uses deobfuscated names, however compiled mods ready for distribution call methods with obfuscated names, since normal Forge environment also uses obfuscated names. Thankfully, many mods also provide deobfuscated versions of themselves (usually called deobf or dev). But even if a mod author doesn't provide deobf version, as long as it's open source, you can compile it yourself. I won't go into detail here how to do it, but it's not that complicated even if you don't understand java).

 

That was the first step. Now, onto the second step.

Put the .jar file you downloaded into "McreatorWorkspace/run/mods". 

That was simple, but it's still not the end. If you try running the testing environment now, it will just crash and give you an error like "Class not found SessionOwner" or something else. That's because we still need to add dependencies into our gradle file.

This is the part that took me the longest to figure out, because I have literally no idea how to work with gradle, and there wasn't a simple tutorial on the internet. But using the method of trial and error, I finally succeeded.

 

Third step, go to folder "MCreatorWorkspace" and open file gradle.build with Notepad++ (or any other text editor. Yes you can even use basic notepad if you want to)

Scroll down to the bottom until you see something that looks like this:

dependencies {
    minecraft 'net.minecraftforge:forge:1.16.5-36.1.0'
}

It's important to note that this file has two "dependencies" sections. We're interested in the most bottom one. Here you need to add three dependencies, one to slf4j-api, second to worldedit-core, and third to worldedit-forge. You have no idea what I just said? Don't worry, 7 hours ago I also wouldn't know. That's why I present you a working code, that you just need to change a little bit.

repositories {
    maven{ url 'https://maven.enginehub.org/repo/' }
	}
	
dependencies {
	implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30' /*It's best to always use the newest release. You can check the newest version by googling slf4j-api*/
	implementation group: "com.sk89q.worldedit", name: "worldedit-core", version: "7.2.0", changing: true /*change 7.2.0 to the worldedit(!) version you downloaded the jar for before*/
    minecraft 'net.minecraftforge:forge:1.16.5-36.1.0' /*don't change this line from your original build.gradle file. It specifies what forge version you're using. If you accidentally changed it, you can see what version you used in Workspace -> Workspace Settings */
	
    compile fg.deobf('com.sk89q.worldedit:worldedit-forge-mc1.16.3:7.2.0:dev') /*change 7.2.0 to the worldedit(!) version you downloaded the jar for before. change 1.16.3 to the version of minecraft you're using (but not to 1.16.5, because as I explained before, 1.16.3 mods work in 1.16.5)*/

And that's all. You just need to paste it where the bottom one "dependencies" section is, change a few values, and you're done. You can now use worldedit in your testing environment. I can't believe myself that it actually took me so long to figure that out, but that's what you get for trying to do things out of your reach. But in the end I made it, so you can take it as a lesson to never give up, even if you completely don't understand something.

Last seen on 09:42, 5. Sep 2023
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Kuba4ful, have you tried…
Wed, 07/21/2021 - 07:59

Kuba4ful, have you tried using fabric and litematica to build? You can copy and paste walls and floors really fast etc. Then you can transfer the save file to Mcreator save folder.

Last seen on 16:24, 8. Jan 2022
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is a really old topic…
Sat, 12/11/2021 - 15:26

This is a really old topic but I have a simpler way of doing things and it's done using CurseMaven.
What you would want to do is add CurseMaven as a repository (it's already mentioned how to do that in the tutorial).
The URL for that is https://cursemaven.com/.
Next thing you want to do is add WorldEdit as a dependency and this time it's even simpler thanks to ForgeGradle's built-in deobfuscate method.
All you have to do is add this to your dependencies:

runtimeOnly fg.deobf("curse.maven:worldedit-225608:3559499")

The file it's adding is 7.2.8 for 1.18. It's determined by the third part of the string (3559499 in this case)
To change the version that's used all you need to do is go to CurseForge, select the desired WorldEdit version, right click the download button and select "Copy Link Address". After that, paste the copied link somewhere and copy the digits after "download/". Then replace 3559499 with the copied digits.

Sounds complicated but it really isn't and it doesn't involve any downloading.
I'm 100% sure if it works with MCreator but it should in theory.

Last seen on 14:46, 22. Jan 2022
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I Make It More Easy
Sat, 12/11/2021 - 16:06

I Make It More Easy

Last seen on 03:52, 28. Jul 2023
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Doesn't work on 1.17 FAILURE…
Fri, 02/04/2022 - 20:19

Doesn't work on 1.17

FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\45435354\MCreatorWorkspaces\addons\build.gradle' line: 60
* What went wrong:
A problem occurred evaluating root project 'addons'.
> Could not find method compile() for arguments [DefaultExternalModuleDependency{group='com.sk89q.worldedit', name='worldedit-forge-mc1.17.1', version='7.2.7', configuration='default'}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
 

Last seen on 03:52, 28. Jul 2023
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Never mind just followed…
Fri, 02/04/2022 - 20:41

Never mind just followed what uSkizzik said. Here's an image of what the build_gradle should look like. All you gotta do is write down the stuff in the red area excpet that apply from mcreator gradle. https://ibb.co/Nj7XJJZ

Last seen on 00:34, 2. Apr 2024
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There's no -dev version of…
Sat, 12/30/2023 - 01:02

There's no -dev version of worldedit for 1.20.1 forge. I can't use this tutorial.

Last seen on 18:18, 19. Apr 2024
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes PercyJames with the…
Sun, 12/31/2023 - 09:22

Yes PercyJames with the plugin that I just made, there is the worldedit API and more, here is the link of my first version:

https://mega.nz/file/P0N02T5S#bAsSZUJM3b7j71VLKO8Af5gDr9FdexftcDLq1TtY-ww

In addition you also have an API to be able to make larger structures, one to use shaders, and StructureGel which is good too and many others.
I haven't sorted it out yet.