Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.16.5] Help with custom Event


Recommended Posts

I have created a custom event which allows me to change the EnchantmentData list in the enchantingtable.

For this I overwritten the enchanting table and the classes connected to it (container, tileentity, screen, etc.).

I looked at the forge events and created my own event from it (Eventfactory and Event).

when I try to use the event I get an error (EventBus#Mod) or it is not called (EventBus#Forge).

since I'm sure (since it is a mod event so EventBus#Mod!?!) that I have to use the EventBus#Mod I don't know why the event doesn't work or why i got an error.

this is my EventFactory:

https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/api/event/ModEventFactory.java

this is my custom event:

https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/api/event/events/EnchantmentSetEvent.java

this is the error log when using EventBus#Mod:

https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/Error Log from Custom Event

 

1. which is the correct EventBus?

2. what's wrong with my event / or is something missing?

 

Link to post
Share on other sites

 

51 minutes ago, loordgek said:

forge bus

is for when the game starts

I already thought I wasn't sure

 

where is the error then?

this is my enchanting table container (where i sue the event)

https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/common/inventory/container/ModEnchantingTableContainer.java

Link to post
Share on other sites

The error is caused by registering the event to the wrong bus.

Change the bus, error goes away.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to post
Share on other sites
17 minutes ago, Draco18s said:

The error is caused by registering the event to the wrong bus.

Change the bus, error goes away.

I've already found out that the bus is wrong

 

5 minutes ago, loordgek said:

you never post the event

what do you mean by that?

do you mean this:

MinecraftForge.EVENT_BUS.post(event)

 

Link to post
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.

Guest
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

    • I am currently using DataGenerators and an ItemProvider to dynamically create each Json file, and even though this successfully runs using runData there is no actual texture when in game. Any Ideas?
    • Trying to figure out the cause of this, unsure what it is i get this error anytime i launch a custom mod pack i created,looked to see if there was invalid depndencies or missing mods, couldnt see anything https://pastebin.com/2ZxW8SVc
    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • If someone know what to do pls help me do i need to reinstall mods or delete some?   ---- Minecraft Crash Report ---- WARNING: coremods are present:   Quark Plugin (Quark-r1.6-178.jar)   SteveKunGLibPlugin (SteveKunG's-Lib-1.12.2-1.1.9.jar)   ForgelinPlugin (Forgelin-1.8.4.jar)   MovingWorldCore (movingworld-1.12-6.353-full.jar)   MekanismCoremod (Mekanism-1.12.2-9.8.3.390.jar)   MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.2.280.jar)   TransformLoader (DynamicSurroundings-1.12.2-3.6.2.1.jar)   FutureMC (future-mc-1.12.2-0.2.6.1.jar) Contact their authors BEFORE contacting forge // You should try our sister game, Minceraft! Time: 4/11/21 11:03 PM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from �3Dynamic Surroundings (dsurround) Caused by: java.lang.ExceptionInInitializerError   at org.orecruncher.dsurround.registry.RegistryManager.initialize(RegistryManager.java:103)   at org.orecruncher.dsurround.proxy.Proxy.loadCompleted(Proxy.java:92)   at org.orecruncher.dsurround.ModBase.loadCompleted(ModBase.java:178)   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)   at java.lang.reflect.Method.invoke(Method.java:498)   at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:637)   at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)   at java.lang.reflect.Method.invoke(Method.java:498)   at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)   at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)   at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)   at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)   at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)   at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)   at com.google.common.eventbus.EventBus.post(EventBus.java:217)   at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)   at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)   at java.lang.reflect.Method.invoke(Method.java:498)   at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)   at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)   at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)   at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)   at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)   at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)   at com.google.common.eventbus.EventBus.post(EventBus.java:217)   at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)   at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:757)   at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336)   at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:535)   at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)   at net.minecraft.client.main.Main.main(SourceFile:123)   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)   at java.lang.reflect.Method.invoke(Method.java:498)   at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)   at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.IllegalArgumentException: No enum constant net.minecraft.util.SoundCategory.DS_FOOTSTEPS   at java.lang.Enum.valueOf(Enum.java:238)   at net.minecraft.util.SoundCategory.valueOf(SourceFile:8)   at org.orecruncher.dsurround.registry.sound.SoundRegistry.<clinit>(SoundRegistry.java:67)   ... 43 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:   Minecraft Version: 1.12.2   Operating System: Windows 10 (amd64) version 10.0   Java Version: 1.8.0_271, Oracle Corporation   Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation   Memory: 2114811232 bytes (2016 MB) / 4294967296 bytes (4096 MB) up to 16777216000 bytes (16000 MB)   JVM Flags: 10 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx16000M -Xms4096M -Xss1M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M   IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0   FML: MCP 9.42 Powered by Forge 14.23.5.2854 39 mods loaded, 39 mods active   States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored   | State  | ID                                           | Version           | Source                                        | Signature                                |   |:------ |:-------------------------------------------- |:----------------- |:--------------------------------------------- |:---------------------------------------- |   | LCHIJA | minecraft                                    | 1.12.2            | minecraft.jar                                 | None                                     |   | LCHIJA | mcp                                          | 9.42              | minecraft.jar                                 | None                                     |   | LCHIJA | FML                                          | 8.0.99.99         | forge-1.12.2-14.23.5.2854.jar                 | e3c3d50c7c986df74c645c0ac54639741c90a557 |   | LCHIJA | forge                                        | 14.23.5.2854      | forge-1.12.2-14.23.5.2854.jar                 | e3c3d50c7c986df74c645c0ac54639741c90a557 |   | LCHIJA | micdoodlecore                                |                   | minecraft.jar                                 | None                                     |   | LCHIJA | com.elytradev.movingworld.common.asm.coremod |                   | minecraft.jar                                 | None                                     |   | LCHIJA | aether_legacy                                | 1.5.3             | aether-1.12.2-v1.5.3.jar                      | None                                     |   | LCHIJA | jei                                          | 4.16.1.301        | jei_1.12.2-4.16.1.301.jar                     | None                                     |   | LCHIJA | quark                                        | r1.6-178          | Quark-r1.6-178.jar                            | None                                     |   | LCHIJA | autoreglib                                   | 1.3-32            | AutoRegLib-1.3-32.jar                         | None                                     |   | LCHIJA | backpack                                     | 3.0.2             | backpack-3.0.2-1.12.2.jar                     | None                                     |   | LCHIJA | bettercaves                                  | 1.12.2            | bettercaves-1.12.2-2.0.4.jar                  | None                                     |   | LCHIJA | bettermineshafts                             | 1.12.2-2.2.1      | BetterMineshaftsForge-1.12.2-2.2.1.jar        | None                                     |   | LCHIJA | bibliocraft                                  | 2.4.5             | BiblioCraft[v2.4.5][MC1.12.2].jar             | None                                     |   | LCHIJA | biomesoplenty                                | 7.0.1.2443        | BiomesOPlenty-1.12.2-7.0.1.2443-universal.jar | None                                     |   | LCHIJA | chameleon                                    | 1.12-4.1.3        | Chameleon-1.12-4.1.3.jar                      | None                                     |   | LCHIJA | chesttransporter                             | 2.8.8             | ChestTransporter-1.12.2-2.8.8.jar             | None                                     |   | LCHIJA | mantle                                       | 1.12-1.3.3.55     | Mantle-1.12-1.3.3.55.jar                      | None                                     |   | LCHIJA | twilightforest                               | 3.11.1021         | twilightforest-1.12.2-3.11.1021-universal.jar | None                                     |   | LCHIJA | tconstruct                                   | 1.12.2-2.13.0.183 | TConstruct-1.12.2-2.13.0.183.jar              | None                                     |   | LCHIJA | conarm                                       | 1.2.5.10          | conarm-1.12.2-1.2.5.10.jar                    | b33d2c8df492beff56d1bbbc92da49b8ab7345a1 |   | LCHIJA | movingworld                                  | 1.12-6.353        | movingworld-1.12-6.353-full.jar               | None                                     |   | LCHIJA | davincisvessels                              | @DVESSELSVER@     | davincisvessels-1.12-6.340-full.jar           | None                                     |   | LCHIJA | galacticraftcore                             | 4.0.2.280         | GalacticraftCore-1.12.2-4.0.2.280.jar         | None                                     |   | LCHIJA | orelib                                       | 3.6.0.1           | OreLib-1.12.2-3.6.0.1.jar                     | 7a2128d395ad96ceb9d9030fbd41d035b435753a |   | LCHIJE | dsurround                                    | 3.6.2.1           | DynamicSurroundings-1.12.2-3.6.2.1.jar        | 7a2128d395ad96ceb9d9030fbd41d035b435753a |   | LCHIJ  | fastleafdecay                                | v14               | FastLeafDecay-v14.jar                         | None                                     |   | LCHIJ  | forgelin                                     | 1.8.4             | Forgelin-1.8.4.jar                            | None                                     |   | LCHIJ  | futuremc                                     | 0.2.6             | future-mc-1.12.2-0.2.6.1.jar                  | None                                     |   | LCHIJ  | galacticraftplanets                          | 4.0.2.280         | Galacticraft-Planets-1.12.2-4.0.2.280.jar     | None                                     |   | LCHIJ  | gravestone                                   | 1.10.1            | gravestone-1.10.1.jar                         | None                                     |   | LCHIJ  | waila                                        | 1.8.26            | Hwyla-1.8.26-B41_1.12.2.jar                   | None                                     |   | LCHIJ  | ironchest                                    | 1.12.2-7.0.67.844 | ironchest-1.12.2-7.0.72.847.jar               | None                                     |   | LCHIJ  | mekanism                                     | 1.12.2-9.8.3.390  | Mekanism-1.12.2-9.8.3.390.jar                 | None                                     |   | LCHIJ  | stevekung's_lib                              | 1.1.9             | SteveKunG's-Lib-1.12.2-1.1.9.jar              | None                                     |   | LCHIJ  | moreplanets                                  | 2.2.1             | More-Planets-1.12.2-2.2.1-GC280.jar           | None                                     |   | LCHIJ  | stg                                          | 1.12.2-1.2.3      | stg-1.12.2-1.2.3.jar                          | None                                     |   | LCHIJ  | storagedrawers                               | 1.12.2-5.4.0      | StorageDrawers-1.12.2-5.4.0.jar               | None                                     |   | LCHIJ  | waystones                                    | 4.1.0             | Waystones_1.12.2-4.1.0.jar                    | None                                     |   Loaded coremods (and transformers):  Quark Plugin (Quark-r1.6-178.jar)   vazkii.quark.base.asm.ClassTransformer SteveKunGLibPlugin (SteveKunG's-Lib-1.12.2-1.1.9.jar)    ForgelinPlugin (Forgelin-1.8.4.jar)    MovingWorldCore (movingworld-1.12-6.353-full.jar)    MekanismCoremod (Mekanism-1.12.2-9.8.3.390.jar)   mekanism.coremod.KeybindingMigrationHelper MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.2.280.jar)   micdoodle8.mods.miccore.MicdoodleTransformer TransformLoader (DynamicSurroundings-1.12.2-3.6.2.1.jar)    FutureMC (future-mc-1.12.2-0.2.6.1.jar)   thedarkcolour.futuremc.asm.CoreTransformer   GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 465.89' Renderer: 'NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2'   Pulsar/tconstruct loaded Pulses:      - TinkerCommons (Enabled/Forced)     - TinkerWorld (Enabled/Not Forced)     - TinkerTools (Enabled/Not Forced)     - TinkerHarvestTools (Enabled/Forced)     - TinkerMeleeWeapons (Enabled/Forced)     - TinkerRangedWeapons (Enabled/Forced)     - TinkerModifiers (Enabled/Forced)     - TinkerSmeltery (Enabled/Not Forced)     - TinkerGadgets (Enabled/Not Forced)     - TinkerOredict (Enabled/Forced)     - TinkerIntegration (Enabled/Forced)     - TinkerFluids (Enabled/Forced)     - TinkerMaterials (Enabled/Forced)     - TinkerModelRegister (Enabled/Forced)     - wailaIntegration (Enabled/Not Forced)     - quarkIntegration (Enabled/Not Forced) [23:03:47] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:func_179870_a:553]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Piotroxx\AppData\Roaming\Crystal-Launcher\instances\u.PiotroxxPack1\.minecraft\crash-reports\crash-2021-04-11_23.03.47-client.txt  
    • The client log shows you trying to connect to a vanilla server. The server log is from a forge server, but it ends (based on the timestamps) before the client log even shows the connection attempt. The server log shows several successful logins.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.