Jump to content

Can't run mod from Eclipse


Quittime

Recommended Posts

Hello! I am a new mod developer so this is my first attempt at creating a mod. I've set up the project just fine according to the tutorials I'm following. I've run "gradlew.bat setupDecompWorkspace" and "gradlew.bat eclipse" and those worked just fine without any errors. Next, I set my eclipse workspace to the "eclipse" folder inside of my project folder. I am basically setting everything up how you are supposed to. After that, I pressed the green play button in eclipse that is supposed to run Forge with my mod, but it just gives this crash instead:

https://pastebin.com/dGFJ9Dni

The only code in my project is just the Hello World example mod code it gives you when you first create a mod. I haven't changed anything. According to the tutorials I'm looking at, this should run fine. What is my problem?

Also, I don't know if this helps, but the JAVA_HOME environment variable is set to C:\Program Files\Java\jdk1.8.0_161 and my PATH variable is set to %JAVA_HOME%\bin

And just to rule the last thing out, both Minecraft and Forge work just fine when running them from the launcher (not from eclipse).

Anyways, I really want to get into modding and this wasn't the warm welcome from Forge I was expecting. Any help is appreciated!

Link to comment
Share on other sites

You should update your JDK.

Also there's no need to set your eclipse workspace inside the mod since Eclipse has added/improved their Gradle integration.

 

Can I ask what particular tutorial you're following?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Link to comment
Share on other sites

32 minutes ago, DaemonUmbra said:

You should update your JDK.

Also there's no need to set your eclipse workspace inside the mod since Eclipse has added/improved their Gradle integration.

 

Can I ask what particular tutorial you're following?

I am following this tutorial here:

https://suppergerrie2.com/minecraft-1-12-modding-with-forge-1-getting-started/

Also, doesn't the Forge Gradle use java 1.8? Also, from all I can see, you need an oracle account to download java 1.8 since it isn't supported anymore.

Link to comment
Share on other sites

9 minutes ago, Quittime said:

Also, from all I can see, you need an oracle account to download java 1.8 since it isn't supported anymore.

This is true, but oracle accounts are free. So make one.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

23 minutes ago, Animefan8888 said:

This is true, but oracle accounts are free. So make one.

Alright. I created an oracle account and downloaded the latest JDK I could find for 1.8 and I got the same crash:

https://pastebin.com/ubszwM66

Edit: also I changed the JAVA_HOME environment variable to the new JDK version as well.

Edited by Quittime
Adding information
Link to comment
Share on other sites

I immediately don't like that tutorial.

Try this one: https://cubicoder.github.io/tutorials/1-12-2/tutorials/

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Link to comment
Share on other sites

51 minutes ago, DaemonUmbra said:

I immediately don't like that tutorial.

Try this one: https://cubicoder.github.io/tutorials/1-12-2/tutorials/

Thank you so much for the suggestion. Sadly, I still get a similar crash when I follow the "setting up the development environment" one:

https://pastebin.com/0kKxKiWd

Edit: This ^ uses the outdated JDK but I re-did it with the latest JDK and it still gives the same crash:

https://pastebin.com/UVbJQiu2

If I do manage to get Forge working properly, I will check it out though ?

Edited by Quittime
Adding information
Link to comment
Share on other sites

What's your GPU?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Link to comment
Share on other sites

Are you able to run the game outside of a dev environment?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Link to comment
Share on other sites

UPDATE: I've discovered that in my crashes contain this line:

OpenGL: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.

 

and I will like to address a few things that make my problem different from other people that get this error. I can run Minecraft and Forge perfectly fine from the launcher, or even other launchers like the technic launcher, unlike most people. My GPU isn't old and its drivers are updated. I have also tried everything on this since a lot of people on other forums recommend it:

http://hopper.minecraft.net/help/pixel-format-not-accelerated/

but nothing applies to me. Remember that I'm still open to suggestions and your help is appreciated. I will continue to search and if I find a solution, I will post it here. Thank you!

Link to comment
Share on other sites

Try running gradlew setupDecompWorkspace --refresh-dependencies

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Link to comment
Share on other sites

I don't know if this will help or not, but when I had this issue on the most recent version: (after they removed setupdecompworkspace)

 

I had to run a command:

gradlew genEclipseRuns

 

To fix my Eclipse, i had to run these commands in this order:

gradlew clean

gradlew genEclipseRuns

gradlew eclipse

 

it was critical to run "genEclipseRuns" before "eclipse."

Link to comment
Share on other sites

19 hours ago, max2461 said:

I don't know if this will help or not, but when I had this issue on the most recent version: (after they removed setupdecompworkspace)

 

I had to run a command:

gradlew genEclipseRuns

 

To fix my Eclipse, i had to run these commands in this order:

gradlew clean

gradlew genEclipseRuns

gradlew eclipse

 

it was critical to run "genEclipseRuns" before "eclipse."

I think that command was introduced in forge for 1.13. In 1.12, like you kind of said, setupDecompWorkspace is used instead.

Link to comment
Share on other sites

I booted up an Ubuntu virtual machine just to see if I would get the same error and it worked! I won't mark this as solved just yet because using a virtual machine with a completely different operating system isn't really a solution. I will still be open to suggestions as well because virtual machines are really slow. I also won't be changing my system's OS to Ubuntu either because that's too much of a commitment and Windows 10 is best for gaming. Anyways, thanks to everyone for the comments. I will try to create some cool mods in Ubuntu, so be prepared for more from me!

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
    • I have been working on a complex block for a mod I'm working on. This block is really unfinished right now, but there is this strange bug that is hindering progress. Basically, this block has a single slot where you put a specific item, then there are three "buttons" on the right like the Enchantment Table. Later on these buttons will have a special purpose so don't worry about them, but right now these buttons just increment a new property on the player as long as they have xp levels. The bug is that whenever you click on one of the three buttons, the items you put in are supposed to decrement, but when you take them out or you reopen the block's gui, the item stack mysteriously "resets", meaning that all the items that were consumed are present again. Here is the Block Entity class (do realize that I am developing this mod in IntelliJ IDEA 2024.1.4 Community Edition): package everyblu.ars_mythos.common.block.tiles; import com.github.alexthe666.iceandfire.item.IafItemRegistry; import everyblu.ars_mythos.client.menus.ArcaneScholarsAnalysisMenu; import everyblu.ars_mythos.common.block.ArcaneScholarsBlock; import everyblu.ars_mythos.common.block.ArsMythosBlockStateProperties; import everyblu.ars_mythos.common.registry.ArsMythosObjectRegistry; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.*; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import software.bernie.geckolib.animatable.GeoBlockEntity; import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache; import software.bernie.geckolib.core.animation.AnimatableManager; import software.bernie.geckolib.core.animation.AnimationController; import software.bernie.geckolib.core.object.PlayState; import software.bernie.geckolib.util.GeckoLibUtil; public class ArcaneScholarsTile extends BlockEntity implements GeoBlockEntity, WorldlyContainer, MenuProvider { public final String variant; private final NonNullList<ItemStack> items = NonNullList.withSize(1, ItemStack.EMPTY); public ArcaneScholarsTile(BlockPos pPos, BlockState pBlockState) { super(ArsMythosObjectRegistry.NEW_ARCANE_SCHOLARS_TILE.get(), pPos, pBlockState); this.variant = switch (pBlockState.getValue(ArsMythosBlockStateProperties.ARCANE_SCHOLARS_VARIANT)) { case 1 -> "fire"; case 2 -> "ice"; default -> "lightning"; }; } @Override public void load(@NotNull CompoundTag tag) { super.load(tag); ContainerHelper.loadAllItems(tag, this.items); System.out.println("loaded"); } @Override protected void saveAdditional(@NotNull CompoundTag tag) { if (this.level == null) return; ContainerHelper.saveAllItems(tag, this.items); super.saveAdditional(tag); } private ArcaneScholarsTile getFootPart() { if (this.level == null) return this; BlockEntity nextEntity = this.level.getBlockEntity( this.getBlockPos().relative(this.getBlockState().getValue(ArcaneScholarsBlock.FACING))); if (nextEntity instanceof ArcaneScholarsTile arcaneScholarsTile) return arcaneScholarsTile; return this; } AnimationController<ArcaneScholarsTile> controller; AnimatableInstanceCache factory = GeckoLibUtil.createInstanceCache(this); @Override public void registerControllers(AnimatableManager.ControllerRegistrar controllerRegistrar) { this.controller = new AnimationController<>(this, "controller", 1, (state) -> PlayState.CONTINUE); controllerRegistrar.add(this.controller); } @Override public AnimatableInstanceCache getAnimatableInstanceCache() { return this.factory; } @Override public @NotNull Component getDisplayName() { return Component.literal("Arcane Scholar's Table"); } @Nullable @Override public AbstractContainerMenu createMenu(int pContainerId, @NotNull Inventory pPlayerInventory, @NotNull Player pPlayer) { BlockEntity entity = this.getFootPart(); return new ArcaneScholarsAnalysisMenu(pContainerId, pPlayerInventory, entity); } @Override public int @NotNull [] getSlotsForFace(@NotNull Direction pSide) { return new int[0]; } @Override public boolean canPlaceItemThroughFace(int pIndex, @NotNull ItemStack pItemStack, @Nullable Direction pDirection) { return pDirection == Direction.UP && pItemStack.is(IafItemRegistry.MANUSCRIPT.get()); } @Override public boolean canTakeItemThroughFace(int pIndex, @NotNull ItemStack pStack, @NotNull Direction pDirection) { return false; } @Override public int getContainerSize() { return 1; } @Override public boolean isEmpty() { return this.items.get(0).isEmpty(); } @Override public @NotNull ItemStack getItem(int pSlot) { return this.items.get(0); } @Override public @NotNull ItemStack removeItem(int pSlot, int pAmount) { ItemStack stack = ContainerHelper.removeItem(this.items, pSlot, pAmount); System.out.println(this.items.get(0).getCount()); return stack; } @Override public @NotNull ItemStack removeItemNoUpdate(int pSlot) { return ContainerHelper.takeItem(this.items, pSlot); } @Override public void setItem(int pSlot, @NotNull ItemStack pStack) { this.items.set(pSlot, pStack); if (pStack.getCount() > this.getMaxStackSize()) { pStack.setCount(this.getMaxStackSize()); } if (!pStack.isEmpty()) this.setChanged(); } @Override public boolean stillValid(@NotNull Player pPlayer) { return Container.stillValidBlockEntity(this, pPlayer); } @Override public void clearContent() { this.items.clear(); } } Here is the AbstractContainerMenu: package everyblu.ars_mythos.client.menus; import everyblu.ars_mythos.client.ArsMythosClientRegistry; import everyblu.ars_mythos.common.block.tiles.ArcaneScholarsTile; import everyblu.ars_mythos.common.capabilities.ArcaneResearchDataProvider; import everyblu.ars_mythos.common.helper.ContainerUtils; import everyblu.ars_mythos.common.registry.ArsMythosObjectRegistry; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.ContainerLevelAccess; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import org.jetbrains.annotations.NotNull; public class ArcaneScholarsAnalysisMenu extends AbstractContainerMenu { private final ArcaneScholarsTile tile; public ArcaneScholarsAnalysisMenu(int index, Inventory playerInventory, FriendlyByteBuf data) { this(index, playerInventory, playerInventory.player.level().getBlockEntity(data.readBlockPos())); } public ArcaneScholarsAnalysisMenu(int index, Inventory playerInventory, BlockEntity entity) { super(ArsMythosClientRegistry.AS_ANALYSIS.get(), index); this.tile = ((ArcaneScholarsTile) entity); ContainerUtils.addPlayerInventoryTo(this, playerInventory); ContainerUtils.addPlayerHotBarTo(this, playerInventory); this.addSlot(new Slot(this.tile, 0, 15, 47)); } @Override public boolean clickMenuButton(@NotNull Player player, int pId) { if (this.tile.isEmpty()) return false; if (player.experienceLevel < 1) return false; player.getCapability(ArcaneResearchDataProvider.RESEARCH_DATA_KEY).ifPresent(research -> research.addOrSubResearch(research.getFireResearch(), 1, 0, 0, true)); player.playSound(SoundEvents.VILLAGER_WORK_CARTOGRAPHER); if (!player.getAbilities().instabuild) { this.tile.removeItem(0, 1); player.experienceLevel--; } return super.clickMenuButton(player, pId); } @Override public @NotNull ItemStack quickMoveStack(@NotNull Player pPlayer, int pIndex) { return ContainerUtils.quickMoveStack(pPlayer, pIndex, this.slots, this, (data) -> this.moveItemStackTo(data.getLeft(), data.getMiddle(), data.getRight(), false), 1); } @Override public boolean stillValid(@NotNull Player pPlayer) { return stillValid( ContainerLevelAccess.create(pPlayer.level(), this.tile.getBlockPos()), pPlayer, ArsMythosObjectRegistry.ARCANE_SCHOLARS_TABLE_FIRE.get()); } public boolean manuscriptsEmpty() { return this.tile.isEmpty(); } } And finally, here is the AbstractContainerScreen (if needed): package everyblu.ars_mythos.client.screens; import com.mojang.blaze3d.systems.RenderSystem; import everyblu.ars_mythos.ArsMythos; import everyblu.ars_mythos.client.menus.ArcaneScholarsAnalysisMenu; import everyblu.ars_mythos.common.capabilities.ArcaneResearchDataProvider; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; import org.jetbrains.annotations.NotNull; public class ArcaneScholarsAnalysisScreen extends AbstractContainerScreen<ArcaneScholarsAnalysisMenu> { public static final ResourceLocation GUI_TEXTURE = ArsMythos.prefix("textures/gui/arcane_scholars_table_analysis.png"); public ArcaneScholarsAnalysisScreen(ArcaneScholarsAnalysisMenu pMenu, Inventory pPlayerInventory, Component pTitle) { super(pMenu, pPlayerInventory, pTitle); } @Override @SuppressWarnings("all") public boolean mouseClicked(double pMouseX, double pMouseY, int pButton) { int x = (this.width - this.imageWidth) / 2; int y = (this.height - this.imageHeight) / 2; for(int k = 0; k < 3; ++k) { double d0 = pMouseX - (double)(x + 60); double d1 = pMouseY - (double)(y + 14 + 19 * k); if (d0 >= 0.0D && d1 >= 0.0D && d0 < 108.0D && d1 < 19.0D && this.menu.clickMenuButton(this.minecraft.player, k)) { this.minecraft.gameMode.handleInventoryButtonClick((this.menu).containerId, k); return true; } } return super.mouseClicked(pMouseX, pMouseY, pButton); } @Override @SuppressWarnings("all") protected void renderBg(@NotNull GuiGraphics guiGraphics, float pPartialTick, int pMouseX, int pMouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShaderTexture(0, GUI_TEXTURE); int x = (this.width - this.imageWidth) / 2; int y = (this.height - this.imageHeight) / 2; guiGraphics.blit(GUI_TEXTURE, x, y, 0, 0, this.imageWidth, this.imageHeight); this.minecraft.player.getCapability(ArcaneResearchDataProvider.RESEARCH_DATA_KEY).ifPresent(research -> guiGraphics.drawString( this.minecraft.font, research.getFireResearch().getLeft().toString(), x + 160, y + 4, 255)); guiGraphics.drawString(this.minecraft.font, String.valueOf(this.minecraft.player.experienceLevel), x + 61, y + 74, 255); for (int k = 0; k < 3; ++k) { if (this.menu.manuscriptsEmpty() || this.minecraft.player.experienceLevel < 1) { guiGraphics.blit(GUI_TEXTURE, x + 60, y + 14 + (19 * k), 0, 185, 108, 19); continue; } guiGraphics.blit(GUI_TEXTURE, x + 60, y + 14 + (19 * k), 0, 166, 108, 19); double d0 = pMouseX - (double)(x + 60); double d1 = pMouseY - (double)(y + 14 + 19 * k); if (d0 >= 0.0D && d1 >= 0.0D && d0 < 108.0D && d1 < 19.0D) { guiGraphics.blit(GUI_TEXTURE, x + 60, y + 14 + (19 * k), 0, 204, 108, 19); } } } @Override public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) { renderBackground(guiGraphics); super.render(guiGraphics, mouseX, mouseY, delta); renderTooltip(guiGraphics, mouseX, mouseY); } } Any help is appreciated.
    • I have this raport to lounch the game The game crashed whilst rendering screen Error: java.lang.NullPointerException: Cannot invoke "net.minecraft.client.gui.components.Button.m_252907_()" because "this.serverBrowser$grabbedMultiplayerButton" is null Kod zakończenia: -1 And full message:   https://ntpd.eu/N3gq6
    • EDIT: I had to declare the library like a mod (using the @Mod annotation and adding the mods.toml + pack.mcmeta files). By doing this it works now Hi everyone  I'm trying to create an internal library for all my mods, and inside it I have a method that registers an Item public static RegistryObject<Item> registerItem(final DeferredRegister<Item> registry, final String name, final Supplier<Item> itemSupplier) { return registry.register(name, itemSupplier); } When the method is called from a mod, Forge raises this error   Exception message: java.lang.LinkageError: loader constraint violation: loader 'SECURE-BOOTSTRAP' @6bedbc4d wants to load class net.minecraftforge.registries.DeferredRegister. A different class with the same name was previously loaded by 'TRANSFORMER' @6d672bd4. (net.minecraftforge.registries.DeferredRegister is in module [email protected] of loader 'TRANSFORMER' @6d672bd4, parent loader 'bootstrap') Both the version of Forge included in the library's build.gradle and the mod's build.gradle are the same. I've never done this, so there's a good chance I'm configuring something wrong. This is the build.gradle file of the library (which is part of a multi-module project)   plugins { id 'net.minecraftforge.gradle' version '[6.0.24,6.2)' } repositories { gradlePluginPortal() maven { name = 'MinecraftForge' url = 'https://maven.minecraftforge.net/' } } java.toolchain.languageVersion = JavaLanguageVersion.of(21) minecraft { mappings channel: 'official', version: minecraft_version reobf = false copyIdeResources = true } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation('net.sf.jopt-simple:jopt-simple:5.0.4') { version { strictly '5.0.4' } } } tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' }  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.