I had a bit of trouble with this, but thanks to TehNut's help here I managed to come up with this solution.
You'll need to register the event handler on the Forge event bus (event tutorials will explain this in more detail).
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Thank you for your help on this. I will work on testing it now. For testing purposes, how do I make it guaranteed to happen?
EDIT: Also, did you write that file just for me or did it already exist?
To make it guaranteed, either comment out && random.nextInt(2) == 0 or change the 2 to 1 (so it always generates 0 and the condition is always true).
I wrote the code specifically for your question.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
To make it guaranteed, either comment out && random.nextInt(2) == 0 or change the 2 to 1 (so it always generates 0 and the condition is always true).
I wrote the code specifically for your question.
thank you and that was very nice of you. The issue I have is that worlds refuse to generate beyond 8% when I have any eventhandler registered or, for that manner, any code relating to one not commented out. Any ideas what could be causing that? It is extremely annoying and has halted all progress on event related stuff =[
thank you and that was very nice of you. The issue I have is that worlds refuse to generate beyond 8% when I have any eventhandler registered or, for that manner, any code relating to one not commented out. Any ideas what could be causing that? It is extremely annoying and has halted all progress on event related stuff =[
I highly doubt that the event system itself is causing this. Do you encounter this issue with only my event handler registered?
Try narrowing it down to a particular event's handler method. You can either test one handler method at a time, commenting out all others or you can do a binary search:
Disable (comment out) half your event handler methods
If the problem persists, repeat step 1 for the enabled methods; else disable the enabled methods and enable the other half
Repeat until you've narrowed it down to one method
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I highly doubt that the event system itself is causing this. Do you encounter this issue with only my event handler registered?
Try narrowing it down to a particular event's handler method. You can either test one handler method at a time, commenting out all others or you can do a binary search:
Disable (comment out) half your event handler methods
If the problem persists, repeat step 1 for the enabled methods; else disable the enabled methods and enable the other half
Repeat until you've narrowed it down to one method
any method period relating to any type of event handler does it (not just yours) and it is all of them. I have done elimination etc and problems don't stop until all are commented out
any method period relating to any type of event handler does it (not just yours) and it is all of them. I have done elimination etc and problems don't stop until all are commented out
That's quite odd. I'd recommend getting a clean copy of Forge and seeing if that fixes it.
Run gradlew clean [cleanEclipse/cleanIdea] (use the task for your IDE) to delete your workspace and IDE project (your code won't be affected).
Delete the C:\Users\YourUser\.gradle folder (~/.gradle on Unix) to clear the Gradle cache
Run gradlew setupDecompWorkspace [eclipse/idea] to set up your workspace and IDE project again
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
That's quite odd. I'd recommend getting a clean copy of Forge and seeing if that fixes it.
Run gradlew clean [cleanEclipse/cleanIdea] (use the task for your IDE) to delete your workspace and IDE project (your code won't be affected).
Delete the C:\Users\YourUser\.gradle folder (~/.gradle on Unix) to clear the Gradle cache
Run gradlew setupDecompWorkspace [eclipse/idea] to set up your workspace and IDE project again
that worked for my low powered laptop but when I put it on ,y decent desktop and resetup the work space I had the same issue, I then went completely through all the steps again and now I have isolated it down to the @SubscribeEvent annotation. It makes minecraft misbehave, mobs dont take damage until 5 minutes after you hit them and tnt does not go off until 1-3 minutes after they die with the annotation active. I comment it out, everything works fine (mobs die on time etc) but the tnt doesn't spawn. This is really annoying and I don't have a clue what is going ok. There are no errors in the console and, as far as the console is concerned, everything is working fine.
That's quite odd. I'd recommend getting a clean copy of Forge and seeing if that fixes it.
Run gradlew clean [cleanEclipse/cleanIdea] (use the task for your IDE) to delete your workspace and IDE project (your code won't be affected).
Delete the C:\Users\YourUser\.gradle folder (~/.gradle on Unix) to clear the Gradle cache
Run gradlew setupDecompWorkspace [eclipse/idea] to set up your workspace and IDE project again
I deleted the exported my code and assets, .gradle folder, renamed my mc mod making folder, made a new folder, installed gradle etc in it, deleted the default template, imported all my stuff, and it now works just fine and behaves normally! :-) I wonder what caused the issue in the old one. It is strange.
Bottom line is, it is working now and your code works. Thank you :-)
You'll need to register the event handler on the Forge event bus (event tutorials will explain this in more detail).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Thank you for your help on this. I will work on testing it now. For testing purposes, how do I make it guaranteed to happen?
EDIT: Also, did you write that file just for me or did it already exist?
To make it guaranteed, either comment out && random.nextInt(2) == 0 or change the 2 to 1 (so it always generates 0 and the condition is always true).
I wrote the code specifically for your question.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
thank you and that was very nice of you. The issue I have is that worlds refuse to generate beyond 8% when I have any eventhandler registered or, for that manner, any code relating to one not commented out. Any ideas what could be causing that? It is extremely annoying and has halted all progress on event related stuff =[
I highly doubt that the event system itself is causing this. Do you encounter this issue with only my event handler registered?
Try narrowing it down to a particular event's handler method. You can either test one handler method at a time, commenting out all others or you can do a binary search:
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
any method period relating to any type of event handler does it (not just yours) and it is all of them. I have done elimination etc and problems don't stop until all are commented out
That's quite odd. I'd recommend getting a clean copy of Forge and seeing if that fixes it.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
that worked for my low powered laptop but when I put it on ,y decent desktop and resetup the work space I had the same issue, I then went completely through all the steps again and now I have isolated it down to the @SubscribeEvent annotation. It makes minecraft misbehave, mobs dont take damage until 5 minutes after you hit them and tnt does not go off until 1-3 minutes after they die with the annotation active. I comment it out, everything works fine (mobs die on time etc) but the tnt doesn't spawn. This is really annoying and I don't have a clue what is going ok. There are no errors in the console and, as far as the console is concerned, everything is working fine.
EDIT: @Choonster do you have any other ideas?
I deleted the exported my code and assets, .gradle folder, renamed my mc mod making folder, made a new folder, installed gradle etc in it, deleted the default template, imported all my stuff, and it now works just fine and behaves normally! :-) I wonder what caused the issue in the old one. It is strange.
Bottom line is, it is working now and your code works. Thank you :-)
I have now marked the thread as resolved.