Jump to content

My mod is loaded but it doesn't work anyway


Faxu_

Recommended Posts

Hello,

I'm trying to do a tiny mod for my server for friends, which is based on block break event. Mod is built without any errors, and it's loaded into client, because I can see it and even check in console. No errors.

But when I interacted with block then nothing happens like I missed something or so. Listeners? EventHandlers? Something should happens but there is no reaction at all in-game and even in console logs.

How do I add event listeners? Maybe I messed up something. Here is short snippet:

public MyMod {
	GLM.register(FMLJavaModLoadingContext.get().getModEventBus());
}

private static final DeferredRegister<Codec<? extends IGlobalLootModifier>> GLM = DeferredRegister.create(ForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, MODID);

I would be glad for any advices.

Regards

Link to comment
Share on other sites

Snippets are useless. Post the full code (preferably on github) so we can see everything in context.

All that code shows is you created a deferred registry. Nothing was registered to it. And nothing that would use any modifier registered to it.

 

Here's an example where I was learning the 1.19 GLMs.

It makes breaking a block in the minecraft:leaves block tag drop a diamond.

https://forums.minecraftforge.net/topic/113816-1182-method-for-iterating-over-blocks-belonging-to-a-tag/?do=findComment&comment=505993

 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

4 hours ago, warjort said:

Snippets are useless. Post the full code (preferably on github) so we can see everything in context.

All that code shows is you created a deferred registry. Nothing was registered to it. And nothing that would use any modifier registered to it.

 

Here's an example where I was learning the 1.19 GLMs.

It makes breaking a block in the minecraft:leaves block tag drop a diamond.

https://forums.minecraftforge.net/topic/113816-1182-method-for-iterating-over-blocks-belonging-to-a-tag/?do=findComment&comment=505993

 

Hi, thanks for reply. I read whole topic that you sent, but I worries that doesn’t work on 1.19.2 but idea and code are similar. Even I did some changes and add more registers, this still didn’t help. My mod did those register events but nothing more. I think I still missing an event listener and I’m reading more about @EventSubscriber, maybe that’s a key. I will send more code if needed.

Link to comment
Share on other sites

Here is a link with code, its kinda messed up because I'm trying a lot of methods to make it works past few days and exhausted to make it clean already.

Code below is based on few examples, and lastest javadoc from forge, however it doesn't work. You can see in console few lines of logs, but the important functions doesn't work. 

https://pastebin.com/PhGySG5P

Link to comment
Share on other sites

Initially you showed the deferred register and nothing else.

Now you show the GLM but not how it is registered?

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

On 11/16/2022 at 10:04 AM, warjort said:

Snippets are useless. Post the full code (preferably on github) so we can see everything in context.

All that code shows is you created a deferred registry. Nothing was registered to it. And nothing that would use any modifier registered to it.

You still haven't done this. See the underline part.

These are the json files in the data folder.

And we will need to see where those are located so we can confirm you have them in the correct place.

 

I shouldn't have to keep asking for this stuff while you drip feed information. You are just wasting people's time.

Either post all the information (as I said on github is the best) or I am just going to ignore this thread until you do.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

23 hours ago, warjort said:

You still haven't done this. See the underline part.

These are the json files in the data folder.

And we will need to see where those are located so we can confirm you have them in the correct place.

 

I shouldn't have to keep asking for this stuff while you drip feed information. You are just wasting people's time.

Either post all the information (as I said on github is the best) or I am just going to ignore this thread until you do.

Here is whole code with json files: https://github.com/TagonZ/MC/tree/main/src/main

I don't know which part of code I'm missing or have wrong to make it work.

 

Link to comment
Share on other sites

All your files are in the wrong place. They should be src/main/resource/data/<namespace> you are missing the data folder in the path

https://github.com/TagonZ/MC/tree/main/src/main/resources/forge

 

Even then, this file would be in the wrong place:

https://github.com/TagonZ/MC/blob/main/src/main/resources/forge/loot_modifiers/cobblestone.json

You reference it here as cobblestonedrops:cobblestone

https://github.com/TagonZ/MC/blob/main/src/main/resources/forge/loot_modifiers/global_loot_modifiers.json

which means it should be in

src/main/resources/data/cobblestonedrops/loot_modifiers/cobblestone.json

see step (2) in the link I posted above.

Quote

A serialized json representing your modifier at /data/<modID>/loot_modifiers/

 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

1 hour ago, warjort said:

All your files are in the wrong place. They should be src/main/resource/data/<namespace> you are missing the data folder in the path

https://github.com/TagonZ/MC/tree/main/src/main/resources/forge

 

Even then, this file would be in the wrong place:

https://github.com/TagonZ/MC/blob/main/src/main/resources/forge/loot_modifiers/cobblestone.json

You reference it here as cobblestonedrops:cobblestone

https://github.com/TagonZ/MC/blob/main/src/main/resources/forge/loot_modifiers/global_loot_modifiers.json

which means it should be in

src/main/resources/data/cobblestonedrops/loot_modifiers/cobblestone.json

see step (2) in the link I posted above.

 

I did those fixes, it works better but still didnt add additional item when mining cobblestone. I pushed on github those fixes. Method doApply isn't used.

https://github.com/TagonZ/MC/tree/main/src/main

Edited by Faxu_
Link to comment
Share on other sites

There's no such block tag as minecraft:cobblestone

https://github.com/misode/mcmeta/tree/data/data/minecraft/tags/blocks

There is a forge:cobblestone/normal

https://github.com/MinecraftForge/MinecraftForge/blob/1.19.x/src/generated/resources/data/forge/tags/blocks/cobblestone/normal.json

 

Or you can change your GLM to use a LootItemCondition that matches a specific block instead of a block tag.

Edited by warjort
  • Like 1

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

2 hours ago, warjort said:

There's no such block tag as minecraft:cobblestone

https://github.com/misode/mcmeta/tree/data/data/minecraft/tags/blocks

There is a forge:cobblestone/normal

https://github.com/MinecraftForge/MinecraftForge/blob/1.19.x/src/generated/resources/data/forge/tags/blocks/cobblestone/normal.json

 

Or you can change your GLM to use a LootItemCondition that matches a specific block instead of a block tag.

Thank you, it's working as intended. For the end of this topic I would ask you how can I add more possible drops from cobblestone. For now it's just a diamond and I can't see possibility to set another item to get diamond and for example coal from mining one cobblestone. Do I have to rebuild my cobblestone.json to make "item" as and array or there is another way to do it?

I know that I can hardcode more items but I dont want to do it this way.

 

Edited by Faxu_
Link to comment
Share on other sites

Just change the codec to use a list of items instead of a single item.

https://forge.gemwire.uk/wiki/Codecs

It's really up to you how much and what configuration you want for your modifiers. 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

https://docs.minecraftforge.net/en/latest/concepts/resources/#resourcelocation

minecraft:diamond

yourmodid:your_item

othermodid:other_item

 

You really need to read the docs/wiki instead of asking these minecraft 101 questions.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

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

    • Hi, I'm trying to hide specific vanilla effects such as levitation or slow falling from the inventory GUI, but I haven't been able to figure out how to do this. I need this because they are triggered by another effect and I don't need them all showing up. Unfortunately, I don't know of any mods that include this feature, and I couldn't find any documentation on the process. I've already looked into the IClientMobEffectExtensions interface, but I'm uncertain about how to implement it in my own effect, let alone in any existing vanilla effect. Please help I am using Forge 47.2.0. for Minecraft 1.20.1
    • Also wondering how to create these manually.  First time creating a forge server.
    • Exception in thread "main" java.lang.IllegalStateException: Could not find forge-1.19-41.1.0 in classpath at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.targets.CommonDevLaunchHandler.lambda$findJarOnClasspath$3(CommonDevLaunchHandler.java:90) at java.base/java.util.Optional.orElseThrow(Optional.java:403) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.targets.CommonDevLaunchHandler.findJarOnClasspath(CommonDevLaunchHandler.java:90) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.targets.ForgeUserdevLaunchHandler.processStreams(ForgeUserdevLaunchHandler.java:17) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.targets.CommonUserdevLaunchHandler.getMinecraftPaths(CommonUserdevLaunchHandler.java:32) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator.scanMods(MinecraftLocator.java:36) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer.discoverMods(ModDiscoverer.java:74) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.FMLLoader.beginModScan(FMLLoader.java:166) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.FMLServiceProvider.beginScanning(FMLServiceProvider.java:86) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:112) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$8(TransformationServicesHandler.java:100) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:102) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:55) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.Launcher.run(Launcher.java:88) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.Launcher.main(Launcher.java:78) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) at cpw.mods.bootstraplauncher@1.1.2/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) I tried to make a minecraft mod but this error appears every time I click on the RunClient button and it won't start. Does anyone know how to get rid of this? (btw. I'm using version 1.19.2-43.3.5) https://pastebin.com/mQ3q4SwW
    • Maybe switch to a pre-configured modpack and use it as working base Add new mods one by one
    • Pure CBD Gummies Dr Oz:Pure CBD Gummies Dr Ozare designed with the help of natural and herbal ingredients and you will get 100% safe and powerful results. This formula is chemical-free that helps you gain many profits at the same time. Some of the main ingredients are discussed below.   ➥ ✅Official Website: https://gummiestoday.com/Pure-CBD-Gummies-Dr-Oz/ ➥ Product Name: Pure CBD Gummies Dr Oz ➥ Benefits: Pure CBD Gummies Dr Oz Helps you to get Pain Relief ➥ Healthy Benefits :Control your hormone levels ➥ Category:Pain Relief Supplement ➥ Rating: ★★★★☆ (4.5/5.0) ➥ Side Effects: No Major Side Effects ➥ Availability: In Stock Voted #1 Product in the United States   ✔Hurry Up – Limited Time Offer – Order Now✔ ✔Hurry Up – Limited Time Offer – Order Now✔ ✔Hurry Up – Limited Time Offer – Order Now✔   Official Facebook Page:- https://www.facebook.com/GreenVibeCBDGummiesForDiabetes https://www.facebook.com/PureCBDGummiesDrOzHowToUse   FOR MORE INFO VISIT OUR WATCH OTHER LINKS :- https://groups.google.com/g/mozilla.dev.platform/c/C4eizlPz3IA https://groups.google.com/a/chromium.org/g/chromium-reviews/c/C4Wqjz6oMOI https://groups.google.com/g/comp.protocols.time.ntp/c/ud96F7mnPIE https://groups.google.com/g/comp.os.vms/c/IfkdfXo_S70 https://groups.google.com/g/drone-dev-platform/c/oOY2NerylW8 https://groups.google.com/g/comp.mobile.android/c/EkBeTeULnTc Other Reference Pages JIMDO@ https://pure-c-b-d-gummies-dr-oz.jimdosite.com/ GROUP GOOGLE@ https://groups.google.com/g/pure-cbd-gummies-dr-oz-advantage/c/YL6pkh7EPac GOOGLE SITE@ https://pure-cbd-gummies-dr-oz-formula.company.site/ GAMMA APP@ https://gamma.app/docs/Pure-CBD-Gummies-Dr-Oz-Beware-Must-Watch-Exposed-Side-Effects-Off-340voj0byn1w4xd Company sites@ https://pure-cbd-gummies-dr-oz-formula.company.site/   Recent Searches:- @@PureCBDGummiesDrOz💲 #PureCBDGummiesDrOzReviews,🥳🥳 #PureCBDGummiesDrOzLifestyle,☘️☘️ #PureCBDGummiesDrOzBenefits,👌 #PureCBDGummiesDrOzBuy,😱😝😱 #PureCBDGummiesDrOzCost,☘📣 #PureCBDGummiesDrOzIngredients,💥💞 #PureCBDGummiesDrOzOrder,👌👀😍 #PureCBDGummiesDrOzPrice,💲 #PureCBDGummiesDrOzWebsite,🔥🔥 #PureCBDGummiesDrOzResults,🔥🔥 #PureCBDGummiesDrOzSideEffects,😱😝😱 #PureCBDGummiesDrOzAdvantage,👌👀😍 #PureCBDGummiesDrOzOffers,,☘📣 #PureCBDGummiesDrOzSupplement,😱😝😱 #PureCBDGummiesDrOzBuyNow,,☘️☘️ #PureCBDGummiesDrOzFormula,💥💞 #PureCBDGummiesDrOzHowToUse,🥳   Our Official Blog Link Below:- BLOGSPOT==>>https://pure-cbd-gummies-dr-oz-ingredients.blogspot.com/2023/12/blog-post.html Sunflower==>>https://www.sunflower-cissp.com/glossary/cissp/7042/pure-cbd-gummies-dr-oz-reviews-warning-controversy-2023-dont-buy-before-reading Lawfully ==>>https://www.lawfully.com/community/posts/pure-cbd-gummies-dr-oz-is-fake-or-real-read-about-100-natural-product-nSNgMm5NlZCC0hvT-5tGWA%3D%3D DIBIZ==>>https://www.dibiz.com/morrislymorales   Medium==>>https://medium.com/@morrislymorales/pure-cbd-gummies-dr-oz-a-review-of-the-most-trusted-and-effective-cbd-product-in-the-market-71cfba6319ca   Devfolio==>>https://devfolio.co/projects/pure-cbd-gummies-dr-oz-3341      
  • Topics

×
×
  • Create New...

Important Information

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